TIMER_SETTIME(2) | System Calls Manual | TIMER_SETTIME(2) |
int
timer_settime(timer_t timerid, int flags, const struct itimerspec * restrict tim, struct itimerspec * restrict otim);
int
timer_gettime(timer_t timerid, struct itimerspec *tim);
int
timer_getoverrun(timer_t timerid);
If the flags argument is set to TIMER_RELTIME then the expiration time is set to the value in nanoseconds specified in the tim argument from the time the call to timer_settime() was made. If the flags argument is set to TIMER_ABSTIME then the expiration time is set to be equal to the difference between the clock associated with this timer, and the value specified in the tim argument. If that time has already passed, then the call succeeds, and the expiration notification occurs.
If the it_interval of the tim argument is non-zero, then the timer reloads upon expiration.
The timer_gettime() function returns the current settings of the timer specified by the timerid argument in the tim argument.
Only one notification event (signal) can be pending for a given timer and process. If a timer expires while the signal is still queued for delivery, then the overrun counter for that timer is increased. The counter can store values up to DELAYTIMER_MAX. When the signal is finally delivered to the process, then the timer_getoverrun() function can be used to retrieve the overrun counter for the timer specified in the timerid argument.
The timer_settime() function will fail if:
May 17, 2010 | NetBSD 6.1 |