timer_getoverrun manpage

Search topic Section

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

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

       #include <time.h>

       int timer_getoverrun(timer_t timerid);

       Link with -lrt.


       timer_getoverrun(): _POSIX_C_SOURCE >= 199309L

       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

       When expiration notifications are delivered via a signal, overruns  can
       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.,
       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.

       On  success, timer_getoverrun() 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.

       EINVAL timerid is not a valid timer ID.

       This system call is available since Linux 2.6.

       POSIX.1-2001, POSIX.1-2008.

       When  timer  notifications are delivered via signals (SIGEV_SIGNAL), on
       Linux it is also possible to obtain the overrun count via the  si_over-
       run  field  of the siginfo_t structure (see sigaction(2)).  This allows

       POSIX.1 discusses timer overruns only in the context of timer notifica-
       tions using signals.

       greater	than  an  implementation-defined maximum, DELAYTIMER_MAX, then
       timer_getoverrun() should return DELAYTIMER_MAX.	 However,  Linux  does
       the maximum representable integer, the counter  cycles,	starting  once
       more from low values.

       See timer_create(2).

       clock_gettime(2), sigaction(2), signalfd(2), sigwaitinfo(2), timer_cre-

       description  of	the project, information about reporting bugs, and the
       latest	 version    of	  this	  page,	   can	   be	  found	    at

Linux				  2015-08-08		   TIMER_GETOVERRUN(2)