Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>setitimer</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
setitimer
=========

Syntax
------

     #include <sys/time.h>
     
     struct itimerval {
       struct timeval it_interval;    /* timer interval */
       struct timeval it_value;       /* current value */
     };
     
     int setitimer(int which, struct itimerval *value, struct itimerval *ovalue);

Description
-----------

Each process has two interval timers, ITIMER_REAL and ITIMER_PROF, which
signal SIGALRM and SIGPROF respectively.  These are typically used to
provide alarm() and profiling capabilities.

This function changes the current value of the interval timer specified
by WHICH to the values in structure VALUE.  The previous value of the
timer is returned if OVALUE is not NULL.  When the timer expires the
appropriate signal is raised.

A timer is defined by the itimerval structure.  If it_value is non-zero
it specifies the time to the next timer expiration.  If it_interval is
non-zero it specifies the value to reload into it_value on timer
expiration.  Setting it_value to zero disables a timer.  Setting
it_interval to zero causes the timer to only happen once instead of
repeating.

Return Value
------------

Returns 0 on success, -1 on failure (and sets errno).


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson