timer_gettime(2) SDK R4.11 timer_gettime(2)
NAME
timergettime - get expiration time and reload interval for a per-
process timer
SYNOPSIS
#include <time.h>
int timergettime (timerid, *val)
timert timerid;
struct itimerspec*val;
DESCRIPTION
Use timergettime(2) to get a per-process timer's expiration time and
reload interval:
timerid is the timer identifier established by timercreate(2).
val points to a structure to contain the requested values.
The structure pointed to by val and a contained structure are shown
below:
struct itimerspec
{
struct timespec itinterval;
struct timespec itvalue;
};
struct timespec
{
timet tvsec;
long tvnsec;
};
The itvalue member is set to the amount of time before timerid next
expires. Even if timerid was enabled with absolute time, this member
contains the interval until next expiration. A value of 0 indicates
that timerid is disabled.
The itinterval member is set to the reload value rounded up to a
multiple of the timer resolution. A value of 0 indicates a one-shot
timer: timerid is disabled upon expiration. A value >0 indicates a
periodic timer: upon expiration, timerid begins a new cycle of this
duration.
Note
* This routine is based on POSIX realtime extension document P1003.4
draft 14. It is therefore subject to change.
* Compilation of a source file using this routine requires that
feature macro _POSIX4_DRAFT_SOURCE be defined. This feature macro
is not enabled by any other feature macro, nor does it enable any
other feature macro.
* The compiled routine must be linked to library librte.a.
RETURN VALUE
If successful, timergettime returns 0. If unsuccessful, the routine
returns -1 and sets ERRNO to one of the following:
EFAULT The caller does not have write access to one or more bytes of
the space pointed to by val.
EINVAL The timerid is invalid.
SEE ALSO
clockgetres(2), clockgettime(2), timercreate(2), timerdelete(2),
timergetoverrun(2), timersettime(2).
Licensed material--property of copyright holder(s)