.\" Copyright (c) 2009 Linux Foundation, written by Michael Kerrisk
.\" <mtk.manpages@gmail.com>
.\"
-.\" %%%LICENSE_START(VERBATIM)
-.\" Permission is granted to make and distribute verbatim copies of this
-.\" manual provided the copyright notice and this permission notice are
-.\" preserved on all copies.
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
-.\" Permission is granted to copy and distribute modified versions of this
-.\" manual under the conditions for verbatim copying, provided that the
-.\" entire resulting derived work is distributed under the terms of a
-.\" permission notice identical to this one.
-.\"
-.\" Since the Linux kernel and libraries are constantly changing, this
-.\" manual page may be incorrect or out-of-date. The author(s) assume no
-.\" responsibility for errors or omissions, or for damages resulting from
-.\" the use of the information contained herein. The author(s) may not
-.\" have taken the same level of care in the production of this manual,
-.\" which is licensed free of charge, as they might when working
-.\" professionally.
-.\"
-.\" Formatted or processed versions of this manual, if unaccompanied by
-.\" the source, must acknowledge the copyright and authors of this work.
-.\" %%%LICENSE_END
-.\"
-.TH TIMER_GETOVERRUN 2 2015-08-08 Linux "Linux Programmer's Manual"
+.TH TIMER_GETOVERRUN 2 2021-03-22 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
.SH NAME
timer_getoverrun \- get overrun count for a POSIX per-process timer
+.SH LIBRARY
+Real-time library
+.RI ( librt ", " \-lrt )
.SH SYNOPSIS
.nf
.B #include <time.h>
-
+.PP
.BI "int timer_getoverrun(timer_t " timerid );
.fi
-
-Link with \fI\-lrt\fP.
.PP
-.in -4n
+.RS -4
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
-.in
+.RE
.PP
.BR timer_getoverrun ():
-_POSIX_C_SOURCE\ >=\ 199309L
+.nf
+ _POSIX_C_SOURCE >= 199309L
+.fi
.SH DESCRIPTION
.BR timer_getoverrun ()
returns the "overrun count" for the timer referred to by
.RB ( SIGEV_SIGNAL ),
and via threads
.RB ( SIGEV_THREAD ).
-
+.PP
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
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.
-
+.PP
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
is not a valid timer ID.
.SH VERSIONS
This system call is available since Linux 2.6.
-.SH CONFORMING TO
+.SH STANDARDS
POSIX.1-2001, POSIX.1-2008.
.SH NOTES
When timer notifications are delivered via signals
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.
-
+.PP
POSIX.1 discusses timer overruns only in the context of
timer notifications using signals.
.\" FIXME . Austin bug filed, 11 Feb 09
+.\" https://www.austingroupbugs.net/view.php?id=95
.SH BUGS
POSIX.1 specifies that if the timer overrun count
is equal to or greater than an implementation-defined maximum,
.BR timer_getoverrun ()
should return
.BR DELAYTIMER_MAX .
-However, Linux does not implement this feature: instead,
+However, before Linux 4.19,
+.\" http://bugzilla.kernel.org/show_bug.cgi?id=12665
if the timer overrun value exceeds the maximum representable integer,
the counter cycles, starting once more from low values.
-.\" Bug filed: http://bugzilla.kernel.org/show_bug.cgi?id=12665
-.\" http://thread.gmane.org/gmane.linux.kernel/113276/
-.SH EXAMPLE
+Since Linux 4.19,
+.\" commit 78c9c4dfbf8c04883941445a195276bb4bb92c76
+.BR timer_getoverrun ()
+returns
+.B DELAYTIMER_MAX
+(defined as
+.B INT_MAX
+in
+.IR <limits.h> )
+in this case (and the overrun value is reset to 0).
+.SH EXAMPLES
See
.BR timer_create (2).
.SH SEE ALSO