We need to define _POSIX_TIMERS to get the prototype for nanosleep in <time.h>.