timer_getoverrun - Online Linux Manual PageSection : 2
Updated : 2022-10-30
Source : Linux man-pages 6.03
NAMEtimer_getoverrun − get overrun count for a POSIX per-process timer
LIBRARYReal-time library (librt, −lrt)
SYNOPSIS#include <time.h>int timer_getoverrun(timer_t timerid);Feature Test Macro Requirements for glibc (see feature_test_macros(7)): timer_getoverrun(): _POSIX_C_SOURCE >= 199309L
DESCRIPTIONtimer_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). 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. The alternative, 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 temporarily blocked, there can be a delay between the time when the notification 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 overrun count is the number of additional timer expirations that occurred between the time when the signal was generated and when it was delivered or accepted. Timer overruns can also occur when expiration notifications are delivered via invocation of a thread, since there may be an arbitrary delay between an expiration of the timer and the invocation of the notification thread, and in that delay interval, additional timer expirations may occur.
RETURN VALUEOn 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.
ERRORSEINVAL timerid is not a valid timer ID.
VERSIONSThis system call is available since Linux 2.6.
STANDARDSPOSIX.1-2001, POSIX.1-2008.
NOTESWhen 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. POSIX.1 discusses timer overruns only in the context of timer notifications using signals.
BUGSPOSIX.1 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, before Linux 4.19, if the timer overrun value exceeds the maximum representable integer, the counter cycles, starting once more from low values. Since Linux 4.19, timer_getoverrun() returns DELAYTIMER_MAX (defined as INT_MAX in <limits.h>) in this case (and the overrun value is reset to 0).
EXAMPLESSee timer_create(2).
SEE ALSOclock_gettime(2), sigaction(2), signalfd(2), sigwaitinfo(2), timer_create(2), timer_delete(2), timer_settime(2), signal(7), time(7) 0
Johanes Gumabo
Data Size : 11,437 byte
man-timer_getoverrun.2Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 3 / 199,979
Visitor ID : :
Visitor IP : 18.116.89.70 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.