timer_settime(2) -- Linux man page
NAMEtimer_settime - Set the time on a POSIX.1b interval timer
- long sys_timer_settime (timer_t timer_id, int flags, const struct itimerspec *new_setting, struct itimerspec *old_setting);
time_settime arms the time and sets the time if the new_setting struct member it_value is non-zero, until the next expiration of the timer specified by timer_id. If the timer was already armed when timer_settime was called, the call resets the time until the next expiration to new_setting. If the it_value of new_setting is zero, then the timer is disarmed. If old_setting is non-NULL, the function stores the previous amount of time before the timer would have expired, or zero if the timer was disarmed along withthe previous timer reload value in this argument.
- An invalid timer_id value was specified.
- The new_setting valid is invalid.