setitimer(2) DG/UX 4.30 setitimer(2)
NAME
setitimer - Sets one of the interval timers.
SYNOPSIS
#include <sys/time.h>
int setitimer (which_timer, new_state_ptr, old_state_ptr)
int which_timer;
struct itimerval *new_state_ptr;
struct itimerval *old_state_ptr;
PARAMETERS
which_timer Specifies which of the three available timers
to set. Can be ITIMER_REAL, ITIMER_VIRTUAL,
or ITIMER_PROF.
new_state_ptr The value to set in the specified timer.
old_state_ptr The previous value of the specified timer is
returned in old_state_ptr if non-zero.
DESCRIPTION
The setitimer system call can set one of three timers:
ITIMER_REAL, ITIMER_VIRTUAL, or ITIMER_PROF.
The ITIMER_REAL timer decrements in real-time. A SIGALRM
signal is delivered to the calling process when the timer
expires.
The ITIMER_VIRTUAL timer decrements when the process is
running in user code. A SIGVTALRM signal is delivered to
the calling process when the timer expires.
The ITIMER_PROF timer decrements both when the process is
running in user code and when the system is running in
behalf of the process. It is designed to be used by
interpreters in statistically profiling the execution of
interpreted programs. A SIGPROF signal is delivered to the
calling process when the timer expires.
The timeval structure defined in <sys/time.h> is of the
form:
struct itimerval
{
struct timeval it_interval; /* timer interval
struct timeval it_value; /* current value
}
If it_value is non-zero, it indicates the time to the next
timer expiration. If it_interval is non-zero, it specifies
a value to be used in reloading it_value when the timer
Licensed material--property of copyright holder(s) Page 1
setitimer(2) DG/UX 4.30 setitimer(2)
expires. Setting it_value to 0 disables a timer. Setting
it_interval to 0 causes a timer to be disabled after its
next expiration.
RETURN VALUE
0 Call was successful
-1 An error occurred. Errno is set to indicate
error.
EXCEPTIONS
Errno may be set to one of the following error codes:
EFAULT The new_state_ptr specified a bad address
EINVAL invalid argument
SEE ALSO
alarm(2), getitimer(2), sigvec(2).
Licensed material--property of copyright holder(s) Page 2