prog.c:7:1: error: unknown type name ‘timer_t’
timer_t timerid;
^~~~~~~
prog.c:9:11: error: unknown type name ‘sigval_t’
void beep(sigval_t sig)
^~~~~~~~
prog.c: In function ‘main’:
prog.c:24:26: error: storage size of ‘sigev’ isn’t known
struct sigevent sigev;
^~~~~
prog.c:25:28: error: storage size of ‘timeval’ isn’t known
struct itimerspec timeval;
^~~~~~~
prog.c:29:30: error: ‘SIGEV_THREAD’ undeclared (first use in this function)
sigev.sigev_notify = SIGEV_THREAD;
^~~~~~~~~~~~
prog.c:29:30: note: each undeclared identifier is reported only once for each function it appears in
prog.c:30:39: error: ‘beep’ undeclared (first use in this function)
sigev.sigev_notify_function = beep;
^~~~
prog.c:37:9: warning: implicit declaration of function ‘timer_create’ [-Wimplicit-function-declaration]
timer_create(CLOCK_MONOTONIC, &sigev, &timerid);
^~~~~~~~~~~~
prog.c:37:22: error: ‘CLOCK_MONOTONIC’ undeclared (first use in this function)
timer_create(CLOCK_MONOTONIC, &sigev, &timerid);
^~~~~~~~~~~~~~~
prog.c:38:9: warning: implicit declaration of function ‘timer_settime’ [-Wimplicit-function-declaration]
timer_settime(timerid, 0, &timeval, NULL);
^~~~~~~~~~~~~
prog.c:42:9: warning: implicit declaration of function ‘nanosleep’ [-Wimplicit-function-declaration]
nanosleep(&ts, NULL);
^~~~~~~~~
prog.c:44:9: warning: implicit declaration of function ‘timer_delete’ [-Wimplicit-function-declaration]
timer_delete(timerid);
^~~~~~~~~~~~
prog.c:25:28: warning: unused variable ‘timeval’ [-Wunused-variable]
struct itimerspec timeval;
^~~~~~~
prog.c:24:26: warning: unused variable ‘sigev’ [-Wunused-variable]
struct sigevent sigev;
^~~~~