Linux Audio
Check our new training course
Embedded Linux Audio
1 2 3 4 5 6 7 8 9 10
#include <unistd.h> #include <sys/time.h> #include "syscall.h" unsigned alarm(unsigned seconds) { struct itimerval it = { .it_value.tv_sec = seconds }; __syscall(SYS_setitimer, ITIMER_REAL, &it, &it); return it.it_value.tv_sec + !!it.it_value.tv_usec; }