perror("timerfd_create");
return 1;
}
- fprintf(stdout, "timerfd = %d\n", tfd);
if (timerfd_settime(tfd, 0, &tmr, NULL))
{
---------------------------------------
relative timer test (at 500 ms) ...
-timerfd = 3
wating timer ...
got timer ticks (1) after 0.5 s
absolute timer test (at 500 ms) ...
wating timer ...
got timer ticks (20) after 2.0 s
O_NONBLOCK test ...
-timerfd = 3
+timerfd = 5
wating timer (flush the single tick) ...
got timer ticks (1) after 0.1 s
success
---------------------------------------
relative timer test (at 500 ms) ...
-timerfd = 3
wating timer ...
got timer ticks (1) after 0.5 s
absolute timer test (at 500 ms) ...
wating timer ...
got timer ticks (20) after 2.0 s
O_NONBLOCK test ...
-timerfd = 3
+timerfd = 5
wating timer (flush the single tick) ...
got timer ticks (1) after 0.1 s
success