OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / man2 / timer_getoverrun.2
1 .\" Copyright (c) 2009 Linux Foundation, written by Michael Kerrisk
2 .\"     <mtk.manpages@gmail.com>
3 .\"
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\"*******************************************************************
24 .\"
25 .\" This file was generated with po4a. Translate the source file.
26 .\"
27 .\"*******************************************************************
28 .TH TIMER_GETOVERRUN 2 2009\-02\-20 Linux "Linux Programmer's Manual"
29 .SH 名前
30 timer_getoverrun \- get overrun count for a POSIX per\-process timer
31 .SH 書式
32 .nf
33 \fB#include <time.h>\fP
34
35 \fBint timer_getoverrun(timer_t \fP\fItimerid\fP\fB);\fP
36 .fi
37
38 Link with \fI\-lrt\fP.
39 .sp
40 .in -4n
41 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
42 .in
43 .sp
44 \fBtimer_getoverrun\fP(): _POSIX_C_SOURCE\ >=\ 199309L
45 .SH 説明
46 \fBtimer_getoverrun\fP()  returns the "overrun count" for the timer referred to
47 by \fItimerid\fP.  An application can use the overrun count to accurately
48 calculate the number of timer expirations that would have occurred over a
49 given time interval.  Timer overruns can occur both when receiving
50 expiration notifications via signals (\fBSIGEV_SIGNAL\fP), and via threads
51 (\fBSIGEV_THREAD\fP).
52
53 When expiration notifications are delivered via a signal, overruns can occur
54 as follows.  Regardless of whether or not a real\-time signal is used for
55 timer notifications, the system queues at most one signal per timer.  (This
56 is the behavior specified by POSIX.1\-2001.  The alternative, queuing one
57 signal for each timer expiration, could easily result in overflowing the
58 allowed limits for queued signals on the system.)  Because of system
59 scheduling delays, or because the signal may be temporarily blocked, there
60 can be a delay between the time when the notification signal is generated
61 and the time when it is delivered (e.g., caught by a signal handler) or
62 accepted (e.g., using \fBsigwaitinfo\fP(2)).  In this interval, further timer
63 expirations may occur.  The timer overrun count is the number of additional
64 timer expirations that occurred between the time when the signal was
65 generated and when it was delivered or accepted.
66
67 Timer overruns can also occur when expiration notifications are delivered
68 via invocation of a thread, since there may be an arbitrary delay between an
69 expiration of the timer and the invocation of the notification thread, and
70 in that delay interval, additional timer expirations may occur
71 .SH 返り値
72 On success, \fBtimer_getoverrun\fP()  returns the overrun count of the
73 specified timer; this count may be 0 if no overruns have occurred.  On
74 failure, \-1 is returned, and \fIerrno\fP is set to indicate the error.
75 .SH エラー
76 .TP 
77 \fBEINVAL\fP
78 \fItimerid\fP is not a valid timer ID.
79 .SH バージョン
80 This system call is available since Linux 2.6.
81 .SH 準拠
82 POSIX.1\-2001.
83 .SH 注意
84 When timer notifications are delivered via signals (\fBSIGEV_SIGNAL\fP), on
85 Linux it is also possible to obtain the overrun count via the \fIsi_overrun\fP
86 field of the \fIsiginfo_t\fP structure (see \fBsigaction\fP(2)).  This allows an
87 application to avoid the overhead of making a system call to obtain the
88 overrun count, but is a nonportable extension to POSIX.1\-2001.
89
90 .\" FIXME . Austin bug filed, 11 Feb 09
91 POSIX.1\-2001 only discusses timer overruns in the context of timer
92 notifications using signals.
93 .SH バグ
94 .\" Bug filed: http://bugzilla.kernel.org/show_bug.cgi?id=12665
95 .\" http://thread.gmane.org/gmane.linux.kernel/113276/
96 POSIX.1\-2001 specifies that if the timer overrun count is equal to or
97 greater than an implementation\-defined maximum, \fBDELAYTIMER_MAX\fP, then
98 \fBtimer_getoverrun\fP()  should return \fBDELAYTIMER_MAX\fP.  However, Linux does
99 not implement this feature: instead, if the timer overrun value exceeds the
100 maximum representable integer, the counter cycles, starting once more from
101 low values.
102 .SH 例
103 See \fBtimer_create\fP(2).
104 .SH 関連項目
105 \fBclock_gettime\fP(2), \fBsigaction\fP(2), \fBsignalfd\fP(2), \fBsigwaitinfo\fP(2),
106 \fBtimer_create\fP(2), \fBtimer_delete\fP(2), \fBtimer_settime\fP(2), \fBsignal\fP(7),
107 \fBtime\fP(7)