GETTIMER(3) SysV GETTIMER(3)
NAME
gettimer - get value of a per-process timer
SYNOPSIS
#include <sys/timers.h>
int gettimer (timerid, tp)
timer_t timerid;
struct itimerspec *tp;
DESCRIPTION
The gettimer function returns an itimerspec structure value to the tp
argument. The time value structure itimerspec specifies the initial timer
value and a repetition interval for use by the per-process timer
function, as defined in sys/timers.h.
The it_value member of the structure represents amount of time in the
current interval before the timer expires for the timer specified in
timerid, or zero if the timer is disabled. The it_interval member has the
value last set by reltimer(3).
The resolution of the timer is 4 microseconds.
The behavior of this function is undefined if tp is NULL.
DIAGNOSTICS
Upon successful completion, the gettimer function returns the value 0
(zero). Otherwise, a value of -1 is returned and errno is set to indicate
the error.
ERRORS
If the gettimer() function fails, errno may be set to the following
value:
[EINVAL] The timerid argument does not specify a known timer.
[EIO] An error occurred when the system-wide clock specified by the
clktyp argument was accessed.
SEE ALSO
alarm(2), getclock(3), mktimer(3), <sys/timers.h>