Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getitimer(2) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

gettimeofday, settimeofday, ftime

sigaction, sigvec, signal



GETITIMER(2,L)              AIX Technical Reference              GETITIMER(2,L)



-------------------------------------------------------------------------------
getitimer, setitimer



PURPOSE

Gets and sets value of internal timer.

SYNTAX

#include <sys/time.h>




      int getitimer (which, value)        int setitimer (which, value, ovalue)
      int which;                          int which;
      struct itimerval *value;            struct itimerval *value, *ovalue;



DESCRIPTION

The getitimer system call returns the current value of the timer specified in
which.  The setitimer system call sets the timer in which to the specified
value, returning the previous value of the timer if ovalue is not 0.

The itimerval structure describes the timer value, as defined in the sys/time.h
header file, and it contains the following members:

      struct timeval  it_interval;    /* timer interval */
      struct timeval  it_value;       /* current value  */

Setting it_interval to 0 disables the timer after it expires.  An it_interval
other than 0 specifies a value used to reload it_value when the timer expires.

The it_value disables the timer immediately when set to 0.  An it_value other
than 0 indicates the time of the next timer expiration.

Time values smaller than the resolution of the system clock are rounded up to
its resolution, defined by IHZ, which is included in sys/param.h.

The which parameter is set to one of the following:

ITIMER_REAL  The timer decrements in real time.  When it expires, the system
             delivers a SIGALRM signal.

ITIMER_VIRTUAL
             The time decrements in process virtual time; it runs only when the
             process is executing.  When it expires, the system delivers a
             SIGVTALRM signal.



Processed November 7, 1990      GETITIMER(2,L)                                1





GETITIMER(2,L)              AIX Technical Reference              GETITIMER(2,L)




ITIMER_PROF  The timer decrements both in process virtual time and when the
             operating system is executing on behalf of the process.  When it
             expires, the system delivers a SIGPROF signal.

RETURN VALUE

Upon successful completion, a value of 0 is returned.  Otherwise, a value of -1
is returned, and errno is set to indicate the error.

ERROR CONDITIONS

The getitimer or setitimer system call fails if one or more of the following is
true:

EFAULT  The value or ovalue parameter points to a location outside of the
        process's allocated address space.

EINVAL  The value parameter specifies a time too large to handle.

EINVAL  The which parameter specifies an illegal value.

RELATED INFORMATION

In this book:  "gettimeofday, settimeofday, ftime" and "sigaction, sigvec,
signal."





























Processed November 7, 1990      GETITIMER(2,L)                                2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026