#define _XOPEN_SOURCE 500 before includes