TIMER_GETOVERRUN



TIMER_GETOVERRUN

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
VERSIONS
CONFORMING TO
NOTES
BUGS
EXAMPLE
SEE ALSO
COLOPHON

NAME

timer_getoverrun − get overrun count for a POSIX per-process timer

SYNOPSIS

#include <time.h>

int timer_getoverrun(timer_t timerid);

Link with −lrt.

Feature Test Macro Requirements for glibc (see feature_test_macros(7)):

timer_getoverrun(): _POSIX_C_SOURCE >= 199309L

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).

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 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 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.

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 (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.

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, 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.

EXAMPLE

See timer_create(2).

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.69 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at http://www.kernel.org/doc/man−pages/.




More Linux Commands

manpages/mcat.1.html
mcat(1) - dump raw disk image (Commands - Linux man page)...
The mcat command is used to copy an entire disk image from or to the floppy device. It uses the following syntax: mcat [-w] drive: Mcat performs the same task a

manpages/gnutls_kx_set_priority.3.html
gnutls_kx_set_priority(3) - API function - Linux man page...
Sets the priority on the key exchange algorithms supported by gnutls. Priority is higher for elements specified before others. After specifying the algorithms y

manpages/upower.1.html
upower(1) - UPower command line tool - Linux manual page....
upower is a simple command line client for the UPower(7) daemon. TODO: not fully documented. OPTIONS --monitor Connect to the UPower daemon and print a line eve

manpages/panel_hidden.3curses.html
panel_hidden(3curses) - panel stack extension for curses....
Panels are ncurses(3NCURSES) windows with the added feature of depth. Panel functions allow the use of stacked windows and ensure the proper portions of each wi

manpages/ktouch.1.html
ktouch(1) a typing tutor for KDE (Commands - Linux man page)
KTouch is a program for learning touch typing. It helps you learn to type on a keyboard quickly and correctly. Every finger has its place on the keyboard with a

manpages/Tcl_FreeResult.3.html
Tcl_FreeResult(3) - manipulate Tcl result - Linux man page
The procedures described here are utilities for manipulating the result value in a Tcl interpreter. The interpreter result may be either a Tcl object or a strin

manpages/Tcl_UtfToUniCharDString.3.html
Tcl_UtfToUniCharDString(3) - routines for manipulating UTF-8
These routines convert between UTF-8 strings and Tcl_UniChars. A Tcl_UniChar is a Unicode character represented as an unsigned, fixed-size quantity. A UTF-8 cha

manpages/hpijs.1.html
hpijs(1) - HP IJS server for the Ghostscript IJS client driv
hpijs should never be called directly. Ghostscript will run it if the IjsServer parameter is set to IjsServer=hpijs when invoking the IJS driver. OPTIONS -h Sho

manpages/Xv.3.html
Xv(3) - X Window System video extension - Linux manual page
The X Video Extension (Xv) extension provides support for video adaptors attached to an X display. It takes the approach that a display may have one or more vid

manpages/red.1.html
red(1) - line-oriented GNU text editor (Linux manual page)
GNU Ed The GNU line editor. OPTIONS -h, --help display this help and exit -V, --version output version information and exit -G, --traditional run in compatibili

manpages/glTexParameteriv.3gl.html
glTexParameteriv(3gl) - set texture parameters (Man Page)...
Texture mapping is a technique that applies an image onto an objects surface as if the image were a decal or cellophane shrink-wrap. The image is created in tex

manpages/gnutls_error_to_alert.3.html
gnutls_error_to_alert(3) - API function - Linux manual page
Get an alert depending on the error code returned by a gnutls function. All alerts sent by this function should be considered fatal. The only exception is when





We can't live, work or learn in freedom unless the software we use is free.