Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

timer_create(3P4)

timer_delete(3P4)

timer_settime(3P4)

timer_gettime(3P4)

NAME

timer_gettime − POSIX 1003.4 Get Value of a Per-process Timer

SYNOPSIS

#include <sys/types.h>
#include <timers.h>

int timer_gettime(timerid, flags, value)
timer_t            timerid
int                flags
struct itimerspec  ∗value

DESCRIPTION

The timer_gettime() function returns the time until the next expiration and timer reload value of the timer specified by timerid previously allocated by the timer_create(3P4) function.  The it_value member of value contains the amount of time before the timer expires or zero if the timer is disarmed.  This value is returned as the interval until timer expiration, even if the timer was set to an absolute value.  The it_interval member of value contains the reload value last set by timer_settime(3P4). 

The itimerspec structure definition is:

struct itimerspec {

struct timespecit_interval;/∗ repetitive timer period ∗/
struct timespecit_value;/∗ initial timer period ∗/

}

The timespec structure definition is:

struct timespec {

time_ttv_sec;/∗ seconds ∗/
longtv_nsec;/∗ nanoseconds ∗/

}

RETURN VALUE

Upon successful completion, the timer_gettime() function returns a zero.  If any of the following conditions occur, the timer_gettime() function shall return -1 and set errno to the corresponding value:

[EINVAL] The timer ID specified by timerid is not a valid timer ID. 

[ENOSYS] The function timer_gettime() is not supported by this implementation. 

FILES

/usr/lib/libposix4.a

SEE ALSO

timer_create(3P4), timer_delete(3P4), timer_settime(3P4). 

WARNING

The interface to timer_gettime() is based on IEEE Draft Standard P1003.4/D12.  This is an unapproved draft, subject to change.  Use of information contained in this unapproved draft is at your own risk.  This interface will change to reflect any changes made by future drafts of POSIX 1003.4. 

CX/UX Programmer’s Reference Manual

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