|TIMER_GETOVERRUN(2)||Linux Programmer's Manual||TIMER_GETOVERRUN(2)|
NAME¶timer_getoverrun - get overrun count for a POSIX per-process timer
#include <time.h> int timer_getoverrun(timer_t timerid);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
DESCRIPTION¶timer_getoverrun() returns the "overrun count" for the timer referred to by timerid. An application can use the overrun count to accurately calculate the number of timer expirations that would have occurred over a given time interval. Timer overruns can occur both when receiving expiration notifications via signals (SIGEV_SIGNAL), and via threads (SIGEV_THREAD).
RETURN VALUE¶On success, timer_getoverrun() returns the overrun count of the specified timer; this count may be 0 if no overruns have occurred. On failure, -1 is returned, and errno is set to indicate the error.
- timerid is not a valid timer ID.
VERSIONS¶This system call is available since Linux 2.6.
NOTES¶When timer notifications are delivered via signals (SIGEV_SIGNAL), on Linux it is also possible to obtain the overrun count via the si_overrun field of the siginfo_t structure (see sigaction(2)). This allows an application to avoid the overhead of making a system call to obtain the overrun count, but is a nonportable extension to POSIX.1-2001.
BUGS¶POSIX.1-2001 specifies that if the timer overrun count is equal to or greater than an implementation-defined maximum, DELAYTIMER_MAX, then timer_getoverrun() should return DELAYTIMER_MAX. However, Linux does not implement this feature: instead, if the timer overrun value exceeds the maximum representable integer, the counter cycles, starting once more from low values.
SEE ALSO¶clock_gettime(2), sigaction(2), signalfd(2), sigwaitinfo(2), timer_create(2), timer_delete(2), timer_settime(2), signal(7), time(7)
COLOPHON¶This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.