Manual Pages for Linux CentOS command on man timer_getoverrun
MyWebUniversity

Manual Pages for Linux CentOS command on man timer_getoverrun

TIMERGETOVERRUN(2) Linux Programmer's Manual TIMERGETOVERRUN(2)

NAME

timergetoverrun - get overrun count for a POSIX per-process timer SYNOPSIS

#include int timergetoverrun(timert timerid);

Link with -lrt. Feature Test Macro Requirements for glibc (see featuretestmacros(7)): timergetoverrun(): POSIXCSOURCE >= 199309L DESCRIPTION timergetoverrun() 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 (SIGEVSIGNAL), and via threads (SIGEVTHREAD). When expiration notifications are delivered via a signal, overruns can

occur as follows. Regardless of whether or not a real-time signal is used for timer notifications, the system queues at most one signal per

timer. (This is the behavior specified by POSIX.1-2001. The alterna‐ tive, queuing one signal for each timer expiration, could easily result in overflowing the allowed limits for queued signals on the system.) Because of system scheduling delays, or because the signal may be tem‐ porarily blocked, there can be a delay between the time when the noti‐ fication signal is generated and the time when it is delivered (e.g., caught by a signal handler) or accepted (e.g., using sigwaitinfo(2)). In this interval, further timer expirations may occur. The timer over‐ run count is the number of additional timer expirations that occurred between the time when the signal was generated and when it was deliv‐ ered or accepted. Timer overruns can also occur when expiration notifications are deliv‐ ered via invocation of a thread, since there may be an arbitrary delay between an expiration of the timer and the invocation of the notifica‐ tion thread, and in that delay interval, additional timer expirations may occur RETURN VALUE On success, timergetoverrun() returns the overrun count of the speci‐ fied timer; this count may be 0 if no overruns have occurred. On fail‐

ure, -1 is returned, and errno is set to indicate the error. ERRORS EINVAL timerid is not a valid timer ID. VERSIONS This system call is available since Linux 2.6. CONFORMING TO

POSIX.1-2001. NOTES When timer notifications are delivered via signals (SIGEVSIGNAL), on Linux it is also possible to obtain the overrun count via the siover‐ run field of the siginfot 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.

POSIX.1-2001 discusses timer overruns only in the context of timer notifications using signals. BUGS

POSIX.1-2001 specifies that if the timer overrun count is equal to or

greater than an implementation-defined maximum, DELAYTIMERMAX, then timergetoverrun() should return DELAYTIMERMAX. 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. EXAMPLE See timercreate(2). SEE ALSO clockgettime(2), sigaction(2), signalfd(2), sigwaitinfo(2), timercre‐ ate(2), timerdelete(2), timersettime(2), signal(7), time(7) COLOPHON

This page is part of release 3.53 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/.

Linux 2009-02-20 TIMERGETOVERRUN(2)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™