www.delorie.com/djgpp/doc/libc/libc_401.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

getitimer

Syntax

 
#include <sys/time.h>

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

Description

This function gets the current value of the interval timer specified by which into structure value. Variable which can have the value of ITIMER_REAL or ITIMER_PROF. See section setitimer, for more details about timers.

Upon return, the it_value member of value will hold the amount of time left until timer expiration, or zero if the timer has expired or was stopped by a previous call to setitimer. The it_interval member will hold the interval between two successive alarms as set by the last call to setitimer (but note that interval values less than the system clock granularity are rounded up to that granularity). The value returned in it_interval member is not set to zero when the timer is stopped, it always retains the interval that was last in use.

Return Value

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

Portability

ANSI/ISO C No
POSIX No


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2004   by DJ Delorie     Updated Apr 2004