I am trying to write a timer in C using timerfd_create() and timer_settime(). I am using CLOCK_MONOTONIC. But though i include these header files,
#include <sys/timerfd.h>
#include <sys/time.h>
#include <sys/types.h>
struct itimerspec timerValue; //This is how i defined the structure
//some code
g_fdRetryTimer = timerfd_create(CLOCK_MONOTONIC, 0);
I am consistently getting the following compilation errors.
error: storage size of ‘timerValue’ isn’t known
error: ‘CLOCK_MONOTONIC’ undeclared (first use in this function)
error: (Each undeclared identifier is reported only once
error: for each function it appears in.)
Please help! Thanks.