reltimer.3c (2010 09)
r
reltimer(3C) reltimer(3C)
NAME
reltimer - relatively arm a per-process timer
SYNOPSIS
#include <sys/timers.h>
int reltimer(
timer_t timerid,
struct itimerspec *value,
struct itimerspec *ovalue
);
DESCRIPTION
The reltimer() function sets the it_value of the specified timer to an offset from the current clock
setting.
If
reltimer() specifies a value argument with the
it_value member equal to zero, the timer is dis-
abled.
reltimer() 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 its resolution; timer values larger
than the maximum value of the specified timer are rounded down to the maximum value (see
mktimer (3C)).
reltimer() returns in the ovalue parameter 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 ovalue are subject to the resolution of the timer, and are the same values that
would be returned by a gettimer() call.
The behavior of this function is undefined if value is NULL.
RETURN VALUE
Upon successful completion,
reltimer() returns zero; otherwise, it returns −1 and sets errno to indi-
cate the error.
ERRORS
reltimer() fails if any of the following conditions are encountered:
[EINVAL]
timerid does not correspond to an ID returned by
mktimer() or the value struc-
ture specified a nanosecond value less than zero or greater than or equal to 1000 mil-
lion.
[EIO] An error occurred while accessing the clock device.
FILES
/usr/include/sys/timers.h
SEE ALSO
timers(2), gettimer(3C), mktimer(3C), thread_safety(5).
STANDARDS CONFORMANCE
reltimer(): AES
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1