HP-UX Reference (11i v2 07/12) - 2 System Calls (vol 5)

g
getitimer(2) getitimer(2)
timerisset Test if a time value is non-zero.
timercmp Compare two time values. (Beware that >=
and <= do not work with the
timercmp macro.)
The timer used with ITIMER_REAL is also used by
alarm() (see alarm(2)). Thus successive calls to
alarm(), getitimer() , and setitimer() set and return the state of a single timer. In addition, a
call to alarm() sets the timer interval to zero.
The interaction between setitimer() and any of
alarm(), sleep() or usleep() is unspecified.
RETURN VALUE
Upon successful completion,
getitimer() or setitimer() returns 0. Otherwise, -1 is returned and
errno is set to indicate the error.
ERRORS
The setitimer() function will fail if:
[EINVAL] The value argument is not in canonical form. (In canonical form, the number of
microseconds is a non-negative integer less than 1,000,000 and the number of seconds
is a non-negative integer.)
The
getitimer() and setitimer() functions may fail if:
[EINVAL] The which argument is not recognized.
[EFAULT] The value structure specified a bad address. Reliable detection of this error is imple-
mentation dependent.
EXAMPLES
The following call to setitimer() sets the real-time interval timer to expire initially after 10 seconds
and every 0.5 seconds thereafter:
struct itimerval rttimer;
struct itimerval old_rttimer;
rttimer.it_value.tv_sec = 10;
rttimer.it_value.tv_usec = 0;
rttimer.it_interval.tv_sec = 0;
rttimer.it_interval.tv_usec = 500000;
setitimer (ITIMER_REAL, &rttimer, &old_rttimer);
AUTHOR
getitimer() was developed by the University of California, Berkeley.
SEE ALSO
alarm(2), exec(2), ualarm(2), usleep(2), sleep(3C), signal(5).
CHANGE HISTORY
First released in Issue 4, Version 2.
HP-UX 11i Version 2: December 2007 Update 2 Hewlett-Packard Company 125