1 .TH GETITIMER 2 "April 14, 2006"
4 getitimer, setitimer \- get and set value of interval timer
10 int getitimer(int \fIwhich\fP, struct itimerval *\fIvalue\fP)
13 int setitimer(int \fIwhich\fP, const struct itimerval *\fIvalue\fP, struct itimerval *\fIovalue\fP);
19 retrieves the current value of the given interval timer, in \fIvalue\fP.
22 sets a new value for the given interval timer, as given in \fIvalue\fP, and, if \fIovalue\fP is not set to
24 stores the old value for the interval timer in \fIovalue\fP.
26 For both functions, the \fIwhich\fP parameter indicates which of the interval timers they work on; \fIwhich\fP can have one of the following values:
30 A timer that is decremented in realtime. When it expires, a
32 signal is delivered to the process.
35 A timer that is decremented in process user time. When it expires, a
37 signal is delivered to the process.
40 A timer that is decremented in process user+system time. When it expires, a
42 signal is delivered to the process.
44 The specified timer will first expire after the time specified in the 'it_value' field of the itimerval structure. Similarly, upon retrieval the 'it_value' field will contain the time after which the timer will expire.
46 If 'it_value' is zero, then the timer is disabled, and the 'it_interval' field is ignored and (upon retrieval) set to zero. Otherwise, 'it_interval' contains the repetition interval after which the timer will repeatedly expire, starting from the moment that the timer expires for the first time according to the 'it_value' value. If 'it_interval' is set to zero, no repetition will occur.
48 The maximum supported timeout value that
50 accepts, depends on the clock tick rate of the operating system.
52 These functions share their real-time timer with
54 Therefore, use of both types of functions in one program yields undefined results.
56 Upon successful completion, these functions return 0. Otherwise, a value of -1 is returned and \fIerrno\fP is set to indicate the error.
58 The functions will fail if any of the following occur:
61 Either \fIwhich\fP is not one of the ITIMER_* constants above, or one of the timeval structures in \fIvalue\fP contains a bad or too large value.
64 Bad \fIvalue\fP or \fIovalue\fP address.
68 David van Moolenbroek <dcvmoole@cs.vu.nl>