OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man3 / ualarm.3
1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
12 .\"
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 .\" GNU General Public License for more details.
17 .\"
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
21 .\" USA.
22 .\"
23 .\" Japanese Version Copyright (c) 2004 Yuichi SATO
24 .\"         all rights reserved.
25 .\" Translated Sat Sep 11 07:32:05 JST 2004
26 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
27 .\" Updated 2007-05-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
28 .\"
29 .TH UALARM 3  2010-09-20 "" "Linux Programmer's Manual"
30 .\"O .SH NAME
31 .SH Ì¾Á°
32 .\"O ualarm \- schedule signal after given number of microseconds
33 ualarm \- »ØÄꤷ¤¿¥Þ¥¤¥¯¥íÉøå¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤ëͽÄê¤ò¤¹¤ë
34 .\"O .SH SYNOPSIS
35 .SH ½ñ¼°
36 .nf
37 .B "#include <unistd.h>"
38 .sp
39 .BI "useconds_t ualarm(useconds_t " usecs ", useconds_t " interval );
40 .fi
41 .sp
42 .in -4n
43 .\"O Feature Test Macro Requirements for glibc (see
44 .\"O .BR feature_test_macros (7)):
45 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
46 .RB ( feature_test_macros (7)
47 »²¾È):
48 .in
49 .sp
50 .BR ualarm ():
51 .ad l
52 .RS 4
53 .PD 0
54 .TP 4
55 .\"O Since glibc 2.12:
56 glibc 2.12 °Ê¹ß:
57 .nf
58 _BSD_SOURCE ||
59     (_XOPEN_SOURCE\ >=\ 500 ||
60         _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) &&
61     !(_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700)
62 .TP 4
63 .fi
64 .\"O Before glibc 2.12:
65 glibc 2.12 ¤è¤êÁ°:
66 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
67 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
68 .PD
69 .RE
70 .ad b
71 .\"O .SH DESCRIPTION
72 .SH ÀâÌÀ
73 .\"O The
74 .\"O .BR ualarm ()
75 .\"O function causes the signal
76 .\"O .B SIGALRM
77 .\"O to be sent to the invoking process after (not less than)
78 .\"O .I usecs
79 .\"O microseconds.
80 .BR ualarm ()
81 ´Ø¿ô¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ
82 .I usecs
83 ¥Þ¥¤¥¯¥íÉà(°Ê¾å) ¸å¤Ë
84 .B SIGALRM
85 ¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£
86 .\"O The delay may be lengthened slightly by any system activity
87 .\"O or by the time spent processing the call or by the
88 .\"O granularity of system timers.
89 ÃÙ¤ì¤Ï¥·¥¹¥Æ¥à¤Î³èÀ­ÅÙ¡¦¸Æ¤Ó½Ð¤·¤Î½èÍý»þ´Ö¡¦
90 ¥·¥¹¥Æ¥à¥¿¥¤¥Þ¡¼¤ÎγÅ٤ˤè¤Ã¤ÆŤ¯¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
91 .LP
92 .\"O Unless caught or ignored, the
93 .\"O .B SIGALRM
94 .\"O signal will terminate the process.
95 Ê᪤ޤ¿¤Ï̵»ë¤µ¤ì¤Ê¤¤¸Â¤ê¡¢
96 .B SIGALRM
97 ¥·¥°¥Ê¥ë¤Ï¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë¡£
98 .LP
99 .\"O If the
100 .\"O .I interval
101 .\"O argument is nonzero, further
102 .\"O .B SIGALRM
103 .\"O signals will be sent every
104 .\"O .I interval
105 .\"O microseconds after the first.
106 .I interval
107 °ú¤­¿ô¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢ºÇ½é¤Î
108 .B SIGALRM
109 ¥·¥°¥Ê¥ë¤Î¸å¡¢
110 ¤µ¤é¤Ë
111 .I interval
112 ¥Þ¥¤¥¯¥íÉÃËè¤Ë SIGALRM ¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£
113 .\"O .SH "RETURN VALUE"
114 .SH ÊÖ¤êÃÍ
115 .\"O This function returns the number of microseconds remaining for
116 .\"O any alarm that was previously set, or 0 if no alarm was pending.
117 ¤³¤Î´Ø¿ô¤Ï¡¢²áµî¤ËÀßÄꤵ¤ì¤¿ alarm ¤Î»Ä¤ê¥Þ¥¤¥¯¥íÉÿô¤òÊÖ¤¹¡£
118 ¼Â¹ÔÃæ¤Î alarm ¤¬¤Ê¤¤¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£
119 .\"O .SH ERRORS
120 .SH ¥¨¥é¡¼
121 .TP
122 .B EINTR
123 .\"O Interrupted by a signal.
124 ¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¡£
125 .TP
126 .B EINVAL
127 .\"O \fIusecs\fP or \fIinterval\fP is not smaller than 1000000.
128 .\"O (On systems where that is considered an error.)
129 \fIusecs\fP ¤Þ¤¿¤Ï \fIinterval\fP ¤¬ 1000000 Ì¤Ëþ¤Ç¤Ê¤¤
130 (¤³¤ì¤¬¥¨¥é¡¼¤È¤·¤Æ°·¤ï¤ì¤ë¥·¥¹¥Æ¥à¤Î¾ì¹ç)¡£
131 .\"O .SH "CONFORMING TO"
132 .SH ½àµò
133 4.3BSD, POSIX.1-2001.
134 .\"O POSIX.1-2001 marks
135 .\"O .BR ualarm ()
136 .\"O as obsolete.
137 POSIX.1-2001 ¤Ç¤Ï
138 .BR ualarm ()
139 ¤Ï²áµî¤Î¤â¤Î¤È¤µ¤ì¤Æ¤¤¤ë¡£
140 .\"O POSIX.1-2008 removes the specification of
141 .\"O .BR ualarm ().
142 POSIX.1-2008 ¤Ç¤Ï¡¢
143 .BR ualarm ()
144 ¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£
145 .\"O 4.3BSD, SUSv2, and POSIX do not define any errors.
146 4.3BSD, SUSv2, POSIX ¤Ï¥¨¥é¡¼¤òÄêµÁ¤·¤Æ¤¤¤Ê¤¤¡£
147 .\"O .SH NOTES
148 .SH Ãí°Õ
149 .\"O The type
150 .\"O .I useconds_t
151 .\"O is an unsigned integer type capable of holding integers
152 .\"O in the range [0,1000000].
153 .I useconds_t
154 ·¿¤Ï [0,1000000] ¤ÎÈϰϤÎÀ°¿ô¤òÊÝ»ý¤Ç¤­¤ëÉä¹æ¤Ê¤·À°¿ô·¿¤Ç¤¢¤ë¡£
155 .\"O On the original BSD implementation, and in glibc before version 2.1,
156 .\"O the arguments to
157 .\"O .BR ualarm ()
158 .\"O were instead typed as
159 .\"O .IR "unsigned int" .
160 ¤â¤È¤â¤È¤Î BSD ¤Ç¤Î¼ÂÁõ¤ä¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢
161 .BR ualarm ()
162 ¤Î°ú¤­¿ô¤Î·¿¤Ï
163 .I "unsigned int"
164 ¤Ç¤¢¤Ã¤¿¡£
165 .\"O Programs will be more portable if they never mention
166 .\"O .I useconds_t
167 .\"O explicitly.
168 ¥×¥í¥°¥é¥àÃæ¤ËÌÀ¼¨Åª¤Ë
169 .I useconds_t
170 ¤È½ñ¤«¤Ê¤¤Êý¤¬¡¢°Ü¿¢À­¤¬¹â¤¯¤Ê¤ë¡£
171 .\"Osato:
172 .\"Osato: mention ¤¬Ìõ¤·¤Å¤é¤¤¡£
173 .\"Osato:
174 .LP
175 .\"O The interaction of this function with
176 .\"O other timer functions such as
177 ¤³¤Î´Ø¿ô¤È
178 .BR alarm (2),
179 .BR sleep (3),
180 .BR nanosleep (2),
181 .BR setitimer (2),
182 .BR timer_create (2),
183 .BR timer_delete (2),
184 .BR timer_getoverrun (2),
185 .BR timer_gettime (2),
186 .BR timer_settime (2),
187 .BR usleep (3)
188 .\"O is unspecified.
189 ¤Î¤è¤¦¤Ê¾¤Î¥¿¥¤¥Þ¡¼´Ø¿ô¤È¤ÎÁê¸ßºîÍѤϵ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
190 .LP
191 .\"O This function is obsolete.
192 .\"O Use
193 .\"O .BR setitimer (2)
194 .\"O or POSIX interval timers
195 .\"O .RB ( timer_create (2),
196 .\"O etc.)
197 .\"O instead.
198 ¤³¤Î´Ø¿ô¤ÏÇÑ»ßͽÄê¤Ç¤¢¤ë¡£
199 Âå¤ï¤ê¤Ë
200 .BR setitimer (2)
201 ¤â¤·¤¯¤Ï POSIX ¥¤¥ó¥¿¡¼¥Ð¥ë¥¿¥¤¥Þ
202 .RB ( timer_create (2)
203 ¤Ê¤É) ¤ò»È¤¦¤³¤È¡£
204 .\"O .SH "SEE ALSO"
205 .SH ´ØÏ¢¹àÌÜ
206 .BR alarm (2),
207 .BR getitimer (2),
208 .BR nanosleep (2),
209 .BR select (2),
210 .BR setitimer (2),
211 .BR usleep (3),
212 .BR time (7)