TIMER_GETTIME(3)

NAME
timer_gettime - get the time remaining before a POSIX timer expires

SYNOPSIS
cc [ flag ... ] file -lrt [ library ... ]

#include <timer.h>

int timer_gettime(timer_t timer_id, struct itimerspec *setting);

DESCRIPTION
timer_gettime gets both the time remaining before the timer specified by timer_id expires and the interval between timer expirations and stores the results in setting. The it_value field of setting contains the time remaining until expiration and the it_interval field contains the timer interval.

If it_value contains zero after a successful return, then the timer is not active. If it_interval contains zero after a successful return, then the timer is not periodic.

RETURN VALUE
On success, timer_gettime returns the value 0 and setting contains the retrieved values.

On failure, timer_gettime returns the value -1 and errno is set appropriately.

ERRORS

EFAULT
    The address specified by setting is outside the address range of the calling process.

CONFORMING TO
POSIX 1003.1b (formerly POSIX.4) as ammended by POSIX 1003.1j-2000.

SEE ALSO
timer_create(3), timer_delete(3), timer_settime(3), timer_getoverrun(3)

IEEE 1003.1b-1993 (POSIX.1b standard, formerly POSIX.4), Section 14 (Clocks and Timers).