You need to add -D_GNU_SOURCE (or #define _GNU_SOURCE first thing) when compiling the code for a GNU/Linux host.