RELTIMER(3) SysV RELTIMER(3)
NAME
reltimer - establish timeout intervals of a per-process timer
SYNOPSIS
#include <sys/timers.h>
int reltimer (tmrid, val, oval)
timer_t tmrid;
struct itimerspec *val;
struct itimerspec *oval;
DESCRIPTION
The reltimer function sets the it_value of the specified timer to an
offset from the current clock setting.
The tmrid argument specifies the per-process timer to access; the val
argument points to a type itimerspec structure containing the values of
the initial and offset timeout intervals. The oval argument points to a
type itimerspec structure where the current value of the timer is to be
stored.
If the reltimer function specifies a val argument with the it_value
member equal to zero, the timer is disabled. The reltimer function
updates the it_interval value of the timer to the value specified. Time
values smaller than the resolution of the specified timer are rounded up
to the resolution value (4 micorseconds). Time values larger than the
maximum timeout value of the specified per-process timer are rounded down
to that maximum value.
The reltimer function returns in the oval argument a value representing
the previous amount of time before the timer would have expired or zero
if the timer was disabled, together with the previous interval timer
period. The members of oval are subject to the resolution of the timer,
and are the same values that would be returned by a gettimer(3) call.
The behavior of this function is undefined if val is NULL.
DIAGNOSTICS
Upon successful completion, the reltimer function returns 0 (zero).
Otherwise, -1 is returned and errno is set to indicate the error.
ERRORS
reltimer fails if:
[EINVAL] The timerid argument does not specify an allocated per-
process timer, or the val argument points to a nanosecond
value less than zero or greater than or equal to 1000
million.
[EIO] An error occurred while accessing the clock.
SEE ALSO
alarm(2), getclock(3), gettimer(3), mktimer(3), <sys/timers.h>