getitimer

Returns the value of interval timers.

Format

#include  <time.h>

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

Arguments

which
The type of interval timer. The DEC C RTL supports only ITIMER_ REAL.
value
Pointer to an itimerval structure whose members specify a timer interval and the time left to the end of the interval.

Description

This function returns the current value for the timer specified by the which argument in the structure pointed to by value.

A timer value is defined by the itimerval structure:

       struct itimerval {
               struct  timeval it_interval;
               struct  timeval it_value;
       };

The following table lists the values for the itimerval structure members:
itimerval Member Value  Meaning 
it_interval = 0  Disables a timer after its next expiration Assumes it_value is nonzero. 
it_interval = nonzero  Specifies a value used in reloading it_value when the timer expires. 
it_value = 0   Disables a timer. 
it_value = nonzero  Indicates the time to the next timer expiration. 

Time values smaller than the resolution of the system clock are rounded up to this resolution.

The DEC C RTL provides each process with one interval timer, defined in the <time.h> header file as ITIMER_REAL. This timer decrements in real time and delivers a SIGALRM signal when the timer expires.

Return Values
Indicates success. 
-1  Indicates an error; errno is set to EINVAL (The value argument specified a time that was too large to handle.)  


Previous Page | Next Page | Table of Contents | Index