add _XOPEN_SOURCE=500 to the config