OSDN Git Service

dae5b77ff7519242d8cfecf4925b06cee26212e5
[linuxjm/LDP_man-pages.git] / draft / man2 / nanosleep.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (C) Markus Kuhn, 1996
4 .\" and Copyright (C) Linux Foundation, 2008, written by Michael Kerrisk
5 .\"     <mtk.manpages@gmail.com>
6 .\"
7 .\" This is free documentation; you can redistribute it and/or
8 .\" modify it under the terms of the GNU General Public License as
9 .\" published by the Free Software Foundation; either version 2 of
10 .\" the License, or (at your option) any later version.
11 .\"
12 .\" The GNU General Public License's references to "object code"
13 .\" and "executables" are to be interpreted as the output of any
14 .\" document formatting or typesetting system, including
15 .\" intermediate and printed output.
16 .\"
17 .\" This manual is distributed in the hope that it will be useful,
18 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
19 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 .\" GNU General Public License for more details.
21 .\"
22 .\" You should have received a copy of the GNU General Public
23 .\" License along with this manual; if not, write to the Free
24 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
25 .\" USA.
26 .\"
27 .\" 1996-04-10  Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
28 .\"             First version written
29 .\" Modified, 2004-10-24, aeb
30 .\" 2008-06-24, mtk
31 .\"     Minor rewrites of some parts.
32 .\"     NOTES: describe case where clock_nanosleep() can be preferable.
33 .\"     NOTES: describe CLOCK_REALTIME versus CLOCK_NANOSLEEP
34 .\"     Replace crufty discussion of HZ with a pointer to time(7).
35 .\"
36 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
37 .\"         all rights reserved.
38 .\" Translated, 1997-02-23, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
39 .\" Updated 1999-02-27, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
40 .\" Updated 2003-09-15, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
41 .\" Updated 2005-02-10, Akihiro MOTOKI
42 .\" Updated 2006-07-23, Akihiro MOTOKI, LDP v2.36
43 .\" Updated 2006-08-13, Akihiro MOTOKI, LDP v2.39
44 .\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05
45 .\"
46 .\"WORD:        puase                   Ää»ß
47 .\"WORD:        sleep                   Ää»ß
48 .\"WORD:        signal                  ¥·¥°¥Ê¥ë
49 .\"WORD:        NULL                    NULL
50 .\"WORD:        block                   ¶Ø»ß(block)
51 .\"WORD:        kernel                  ¥«¡¼¥Í¥ë
52 .\"WORD:        real-time               ¥ê¥¢¥ë¡¦¥¿¥¤¥à
53 .\"WORD:        schedule                ¥¹¥±¥¸¥å¡¼¥ë
54 .\"WORD:        busy wait               ¥Ó¥·¡¼¡¦¥¦¥§¥¤¥È
55 .\"
56 .TH NANOSLEEP 2 2009-01-19 "Linux" "Linux Programmer's Manual"
57 .\"O .SH NAME
58 .SH Ì¾Á°
59 .\"O nanosleep \- high-resolution sleep
60 nanosleep \- ¹âÀºÅ٤ʥ¹¥ê¡¼¥×
61 .\"O .SH SYNOPSIS
62 .SH ½ñ¼°
63 .B #include <time.h>
64 .sp
65 .BI "int nanosleep(const struct timespec *" req ", struct timespec *" rem );
66 .sp
67 .in -4n
68 .\"O Feature Test Macro Requirements for glibc (see
69 .\"O .BR feature_test_macros (7)):
70 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
71 .RB ( feature_test_macros (7)
72 »²¾È):
73 .in
74 .sp
75 .BR nanosleep ():
76 _POSIX_C_SOURCE\ >=\ 199309L
77 .\"O .SH DESCRIPTION
78 .SH ÀâÌÀ
79 .\"O .BR nanosleep ()
80 .\"O suspends the execution of the calling thread
81 .\"O until either at least the time specified in
82 .\"O .IR *req
83 .\"O has elapsed, or the delivery of a signal
84 .\"O that triggers the invocation of a handler in the calling thread or
85 .\"O that terminates the process.
86 .BR nanosleep ()
87 ¤Ï¡¢¾¯¤Ê¤¯¤È¤â
88 .I *req
89 ¤Ç»ØÄꤵ¤ì¤¿»þ´Ö¤Î´Ö¡¢¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤òÃٱ䤵¤»¤ë¡£
90 .BR nanosleep ()
91 ¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤ò¡¢
92 ¾¯¤Ê¤¯¤È¤â
93 .I *req
94 ¤Ç»ØÄꤵ¤ì¤¿»þ´Ö¤Î´Ö¡¢¤â¤·¤¯¤Ï¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Ç¥Ï¥ó¥É¥é¤Îµ¯Æ°¤Î
95 ¤­¤Ã¤«¤±¤È¤Ê¤ë¥·¥°¥Ê¥ë¡¢¤Þ¤¿¤Ï¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë¥·¥°¥Ê¥ë¤ÎÇÛÁ÷¤¬
96 ¹Ô¤ï¤ì¤ë¤Þ¤Ç°ì»þÄä»ß¤¹¤ë¡£
97
98 .\"O If the call is interrupted by a signal handler,
99 .\"O .BR nanosleep ()
100 .\"O returns \-1, sets \fIerrno\fP to
101 .\"O .BR EINTR ,
102 .\"O and writes the remaining time into the structure pointed to by
103 .\"O .I rem
104 .\"O unless
105 .\"O .I rem
106 .\"O is NULL.
107 ¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢
108 .BR nanosleep
109 ¤Ï \-1 ¤òÊÖ¤·¡¢
110 .I errno
111 ¤Ë
112 .B EINTR
113 ¤òÀßÄꤷ¡¢
114 .I rem
115 ¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð
116 »Ä¤ê¤Î»þ´Ö¤ò
117 .I rem
118 ¤¬»Ø¤¹¹½Â¤ÂΤ˳ÊǼ¤¹¤ë¡£
119 .\"O The value of
120 .\"O .I *rem
121 .\"O can then be used to call
122 .\"O .BR nanosleep ()
123 .\"O again and complete the specified pause (but see NOTES).
124 .I *rem
125 ¤ÎÃͤò»È¤¦¤È¡¢
126 .BR nanosleep ()
127 ¤ò¤â¤¦°ìÅٸƤӽФ·¤Æ¡¢»ØÄꤷ¤¿»þ´Ö¤ÎÄä»ß¤ò
128 ´°Î»¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë (⤷¡¢¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È)¡£
129
130 .\"O The structure
131 .\"O .I timespec
132 .\"O is used to specify intervals of time with nanosecond precision.
133 .\"O It is defined as follows:
134 ¥Ê¥ÎÉùï¤ß¤Î»þ´Ö´Ö³Ö¤ò»ØÄꤹ¤ë¤Î¤Ë
135 .I timespec
136 ¹½Â¤ÂΤ¬»ÈÍѤµ¤ì¤ë¡£¤³¤Î¹½Â¤ÂΤϼ¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
137 .sp
138 .in +4n
139 .nf
140 .\"O struct timespec {
141 .\"O     time_t tv_sec;        /* seconds */
142 .\"O     long   tv_nsec;       /* nanoseconds */
143     time_t tv_sec;        /* Éà*/
144     long   tv_nsec;       /* ¥Ê¥ÎÉà*/
145 };
146 .fi
147 .in
148 .PP
149 .\"O The value of the nanoseconds field must be in the range 0 to 999999999.
150 ¥Ê¥ÎÉäΥե£¡¼¥ë¥É¤ÎÃͤϠ0 ¤«¤é 999999999 ¤ÎÈϰϤˤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
151
152 .\"O Compared to
153 .\"O .BR sleep  (3)
154 .\"O and
155 .\"O .BR usleep (3),
156 .\"O .BR nanosleep ()
157 .\"O has the following advantages:
158 .\"O it provides a higher resolution for specifying the sleep interval;
159 .\"O POSIX.1 explicitly specifies that it
160 .\"O does not interact with signals;
161 .\"O and it makes the task of resuming a sleep that has been
162 .\"O interrupted by a signal handler easier.
163 .BR sleep  (3)
164 ¤ä
165 .BR usleep (3)
166 ¤ËÈæ¤Ù¤ë¤È
167 .BR nanosleep ()
168 ¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤ÊÍøÅÀ¤¬¤¢¤ë:
169 Ää»ß´ü´Ö¤Î»ØÄê¤Ë´Ø¤·¤Æ¹â¤¤»þ´Öʬ²òǽ¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£
170 ¥·¥°¥Ê¥ë¤È¸ß¤¤¤Ë±Æ¶Á¤òµÚ¤Ü¤¹¤³¤È¤¬¤Ê¤¤¤È
171 POSIX.1 ¤ÇÌÀ¼¨Åª¤Ëµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
172 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿ºÝ¤Ë¡¢Ää»ß¤òºÆ³«¤¹¤ë¤Î¤¬
173 ¤è¤ê´Êñ¤Ë¤Ç¤­¤ë¡£
174 .\"O .SH "RETURN VALUE"
175 .SH ÊÖ¤êÃÍ
176 .\"O On successfully sleeping for the requested interval,
177 .\"O .BR nanosleep ()
178 .\"O returns 0.
179 .\"O If the call is interrupted by a signal handler or encounters an error,
180 .\"O then it returns \-1, with
181 .\"O .I errno
182 .\"O set to indicate the error.
183 Í׵ᤵ¤ì¤¿´ü´Ö¤ÎÄä»ß¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢
184 .BR nanosleep ()
185 ¤Ï 0 ¤òÊÖ¤¹¡£¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¤ê¡¢
186 ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï¡¢\-1 ¤òÊÖ¤·¡¢
187 .I errno
188 ¤Ë¥¨¥é¡¼ÆâÍƤò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
189 .\"O .SH ERRORS
190 .SH ¥¨¥é¡¼
191 .TP
192 .B EFAULT
193 .\"O Problem with copying information from user space.
194 ¥æ¡¼¥¶¶õ´Ö¤«¤é¤Î¾ðÊó¤Î¥³¥Ô¡¼¤ÇÌäÂ꤬¤¢¤Ã¤¿¡£
195 .TP
196 .B EINTR
197 .\"O The pause has been interrupted by a signal that was
198 .\"O delivered to the thread.
199 .\"O The remaining sleep time has been written
200 .\"O into \fI*rem\fP so that the thread can easily call
201 .\"O .BR nanosleep ()
202 .\"O again and continue with the pause.
203 ¤½¤Î¥¹¥ì¥Ã¥É¤ËÇÛÁ÷¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Ë¤è¤êÄä»ß¤¬ÃæÃǤµ¤ì¤¿¡£
204 ¥¹¥ì¥Ã¥É¤¬´Êñ¤Ë
205 .BR nanosleep ()
206 ¤òºÆ¤Ó¸Æ¤Ó½Ð¤·¤ÆÄä»ß¤ò³¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¡¢
207 »Ä¤ê¤ÎÄä»ß»þ´Ö¤¬ \fI*rem\fP ¤Ë³ÊǼ¤µ¤ì¤ë¡£
208 .TP
209 .B EINVAL
210 .\"O The value in the
211 .\"O .I tv_nsec
212 .\"O field was not in the range 0 to 999999999 or
213 .\"O .I tv_sec
214 .\"O was negative.
215 .I tv_nsec
216 ¥Õ¥£¡¼¥ë¥É¤ÎÃͤ¬ 0 ¤«¤é 999999999 ¤Þ¤Ç¤ÎÈϰϤˤʤ«¤Ã¤¿¤«¡¢
217 .I tv_sec
218 ¤¬Éé¤Ç¤¢¤Ã¤¿¡£
219 .\"O .SH "CONFORMING TO"
220 .SH ½àµò
221 POSIX.1-2001.
222 .\"O .SH NOTES
223 .SH Ãí°Õ
224 .\"O If the interval specified in
225 .\"O .I req
226 .\"O is not an exact multiple of the granularity underlying clock (see
227 .\"O .BR time (7)),
228 .\"O then the interval will be rounded up to the next multiple.
229 .\"O Furthermore, after the sleep completes, there may still be a delay before
230 .\"O the CPU becomes free to once again execute the calling thread.
231 .I req
232 ¤Ç»ØÄꤵ¤ì¤¿´ü´Ö¤¬¡¢ÆâÉô¤Ç»ÈÍѤµ¤ì¤ë¥¯¥í¥Ã¥¯¤ÎγÅÙ¤ÎÇÜ¿ô¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤
233 ¾ì¹ç¡¢´ü´Ö¤Ï°ìÈֶᤤÇÜ¿ô¤ËÀÚ¤ê¾å¤²¤é¤ì¤ë¡£
234 ¤Þ¤¿¡¢Ää»ß¤¬´°Î»¤·¤¿¸å¡¢CPU ¤¬¸Æ¤Ó½Ð¤·¸µ¤Î¥¹¥ì¥Ã¥É¤òºÆ¤Ó¼Â¹Ô¤Ç¤­¤ë¤è¤¦¤Ë
235 ¤Ê¤ë¤Þ¤Ç¤Ë¤ÏÃٱ䤬Æþ¤ë¡£
236
237 .\"O The fact that
238 .\"O .BR nanosleep ()
239 .\"O sleeps for a relative interval can be problematic if the call
240 .\"O is repeatedly restarted after being interrupted by signals,
241 .\"O since the time between the interruptions and restarts of the call
242 .\"O will lead to drift in the time when the sleep finally completes.
243 .\"O This problem can be avoided by using
244 .\"O .BR clock_nanosleep (2)
245 .\"O with an absolute time value.
246 ¥·¥°¥Ê¥ë¤Ë¤è¤ë³ä¤ê¹þ¤ß¸å¤Ë·«¤êÊÖ¤·ºÆ³«¤µ¤ì¤¿¾ì¹ç¡¢
247 .BR nanosleep ()
248 ¤ÎÄä»ß¤¬ÁêÂÐŪ¤Ê´ü´Ö¤Ç¤¢¤ë¤³¤È¤ÏÌäÂê¤È¤Ê¤ë¤³¤È¤¬¤¢¤ë¡£
249 ¤³¤ì¤Ï¡¢¸Æ¤Ó½Ð¤·¤Î³ä¤ê¹þ¤ß¤«¤éºÆ³«¤Þ¤Ç¤Î´Ö¤Î»þ´Ö¤¬¸¶°ø¤Ç
250 Ää»ß¤¬ºÇ½ªÅª¤Ë´°Î»¤·¤¿ºÝ¤Ë»þ´Ö¤Ë¤º¤ì¤¬È¯À¸¤¹¤ë¤«¤é¤Ç¤¢¤ë¡£
251 ¤³¤ÎÌäÂê¤Ï¡¢ÀäÂлþ¹ï¤¬»ØÄê¤Ç¤­¤ë
252 .BR clock_nanosleep (2)
253 ¤ò»È¤¦¤³¤È¤Ç²óÈò¤Ç¤­¤ë¡£
254
255 .\"O POSIX.1 specifies that
256 .\"O .BR nanosleep ()
257 .\"O should measure time against the
258 .\"O .B CLOCK_REALTIME
259 .\"O clock.
260 .\"O However, Linux measures the time using the
261 .\"O .B CLOCK_MONOTONIC
262 .\"O clock.
263 POSIX.1 ¤Ï¡¢
264 .BR nanosleep ()
265 ¤Ï
266 .B CLOCK_REALTIME
267 ¤ËÂФ·¤Æ»þ¹ï¤ò·×¬¤¹¤ë¤Ù¤­¤À¤Èµ¬Äꤷ¤Æ¤¤¤ë¡£
268 ¤·¤«¤·¤Ê¤¬¤é¡¢Linux ¤Ï
269 .B CLOCK_MONOTONIC
270 ¥¯¥í¥Ã¥¯¤òÍѤ¤¤Æ»þ¹ï¤ò·×¬¤·¤Æ¤¤¤ë¡£
271 .\" See also http://thread.gmane.org/gmane.linux.kernel/696854/
272 .\" Subject: nanosleep() uses CLOCK_MONOTONIC, should be CLOCK_REALTIME?
273 .\" Date: 2008-06-22 07:35:41 GMT
274 .\"O This probably does not matter, since the POSIX.1 specification for
275 .\"O .BR clock_settime (2)
276 .\"O says that discontinuous changes in
277 .\"O .B CLOCK_REALTIME
278 .\"O should not affect
279 .\"O .BR nanosleep ():
280 ¤³¤Î¤³¤È¤Ï¤ª¤½¤é¤¯ÌäÂê¤Ë¤Ê¤é¤Ê¤¤¤À¤í¤¦¡£
281 ¤Ê¤¼¤Ê¤é¡¢POSIX.1 ¤Î
282 .BR clock_settime (2)
283 ¤Î»ÅÍͤˤϡ¢
284 .B CLOCK_REALTIME
285 ¤ÎÉÔϢ³¤ÊÊѲ½¤Ï
286 .BR nanosleep ()
287 ¤Ë±Æ¶Á¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡¢¤È½ñ¤«¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£
288 .RS
289 .PP
290 .\"O Setting the value of the
291 .\"O .B CLOCK_REALTIME
292 .\"O clock via
293 .\"O .BR clock_settime (2)
294 .\"O shall
295 .\"O have no effect on threads that are blocked waiting for a relative time
296 .\"O service based upon this clock, including the
297 .\"O .BR nanosleep ()
298 .\"O function; ...
299 .\"O Consequently, these time services shall expire when the requested relative
300 .\"O interval elapses, independently of the new or old value of the clock.
301 .BR clock_settime (2)
302 ·Ðͳ¤Ç
303 .B CLOCK_REALTIME
304 ¥¯¥í¥Ã¥¯¤ÎÃͤòÀßÄꤷ¤Æ¤â¡¢
305 .BR nanosleep ()
306 ´Ø¿ô¤Ê¤É¤Î
307 .B CLOCK_REALTIME
308 ¤Ë´ð¤Å¤¯¥µ¡¼¥Ó¥¹¤Ë¤è¤êÁêÂÐŪ¤Ê´ü´Ö¤À¤±¼Â¹Ô¤òÄä»ß¤¹¤ë¥¹¥ì¥Ã¥É¤Ë¤Ï±Æ¶Á¤Ï¤Ê¤¤¡£
309 ·ë²Ì¤È¤·¤Æ¡¢¥¯¥í¥Ã¥¯Ãͤ¬¹¹¿·Á°¤«¸å¤«¤Ë´Ø¤ï¤é¤º¡¢Í׵ᤵ¤ì¤¿ÁêÂÐŪ¤Ê»þ´Ö¤¬
310 ·Ð²á¤¹¤ë¤ÈËþλ¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£
311 .RE
312 .\"O .SS "Old behavior"
313 .SS °ÊÁ°¤ÎÆ°ºî
314 .\"O In order to support applications requiring much more precise pauses
315 .\"O (e.g., in order to control some time-critical hardware),
316 .\"O .BR nanosleep ()
317 .\"O would handle pauses of up to 2\ ms by busy waiting with microsecond
318 .\"O precision when called from a thread scheduled under a real-time policy
319 .\"O like
320 .\"O .B SCHED_FIFO
321 .\"O or
322 .\"O .BR SCHED_RR .
323 .\"O This special extension was removed in kernel 2.5.39,
324 .\"O hence is still present in
325 .\"O current 2.4 kernels, but not in 2.6 kernels.
326 (Î㤨¤Ð¡¢»þ´Ö¤¬½ÅÍפʰÕÌ£¤ò»ý¤Ä¥Ï¡¼¥É¥¦¥§¥¢¤òÀ©¸æ¤¹¤ë¾ì¹ç¤Ê¤É)
327 ¤è¤êÀµ³Î¤ÊÄä»ß¤òɬÍפȤ¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÂбþ¤¹¤ë¤¿¤á¤Ë¡¢
328 .BR nanosleep ()
329 ¤Ï¡¢¥Þ¥¤¥¯¥íÉÃÀºÅ٤Υӥ¸¡¼¡¦¥¦¥§¥¤¥È¤òÍøÍѤ¹¤ë¤³¤È¤Ç¡¢
330 2\ ms °Ê²¼¤ÎÄä»ß¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤¿¡£
331 ⤷¡¢¤³¤Îµ¡Ç½¤òÍøÍѤ¹¤ë¤Ë¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥¹¥ì¥Ã¥É¤¬
332 .B SCHED_FIFO
333 ¤ä
334 .B SCHED_RR
335 ¤È¤¤¤Ã¤¿¥ê¥¢¥ë¥¿¥¤¥à¡¦¥Ý¥ê¥·¡¼¤Î¸µ¤Ç¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤Æ¤¤¤ë
336 ɬÍפ¬¤¢¤Ã¤¿¡£
337 ¤³¤ÎÆÃÊ̤ʳÈÄ¥¤Ï¥«¡¼¥Í¥ë 2.5.39 ¤Çºï½ü¤µ¤ì¤¿¡£¤·¤¿¤¬¤Ã¤Æ¡¢
338 ¸½ºß¤Î 2.4 ·ÏÎó¤Î¥«¡¼¥Í¥ë¤Ë¤Ï¤³¤Îµ¡Ç½¤¬Â¸ºß¤¹¤ë¤¬¡¢
339 2.6·ÏÎó¤Î¥«¡¼¥Í¥ë¤Ë¤Ï¤Ê¤¤¡£
340 .\"O .SH BUGS
341 .SH ¥Ð¥°
342 .\"O In Linux 2.4, if
343 .\"O .BR nanosleep ()
344 .\"O is stopped by a signal (e.g.,
345 .\"O .BR SIGTSTP ),
346 .\"O then the call fails with the error
347 .\"O .B EINTR
348 .\"O after the thread is resumed by a
349 .\"O .B SIGCONT
350 .\"O signal.
351 .\"O If the system call is subsequently restarted,
352 .\"O then the time that the thread spent in the stopped state is
353 .\"O \fInot\fP counted against the sleep interval.
354 Linux 2.4 ¤Ç¤Ï¡¢
355 .BR nanosleep ()
356 ¤¬
357 .RB ( SIGTSTP
358 ¤Ê¤É¤Î) ¥·¥°¥Ê¥ë¤Ë¤è¤êÄä»ß¤µ¤ì¤¿¾ì¹ç¡¢
359 .BR nanosleep ()
360 ¤Î¸Æ¤Ó½Ð¤·¤Ï
361 .B SIGCONT
362 ¥·¥°¥Ê¥ë¤Ë¤è¤ë¥¹¥ì¥Ã¥É¤ÎºÆ³«¸å¤Ë
363 .B EINTR
364 ¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¡£
365 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤³¤Î¸å¤ÇºÆ¥¹¥¿¡¼¥È¤µ¤ì¤¿¾ì¹ç¡¢
366 ¥¹¥ì¥Ã¥É¤¬Ää»ß¾õÂ֤ˤ¢¤ë´Ö¤Ë·Ð²á¤·¤¿»þ´Ö¤Ï
367 Ää»ß´ü´Ö¤È¤·¤Æ¥«¥¦¥ó¥È¡Ö¤µ¤ì¤Ê¤¤¡×¡£
368 .\"O .SH "SEE ALSO"
369 .SH ´ØÏ¢¹àÌÜ
370 .BR clock_nanosleep (2),
371 .BR sched_setscheduler (2),
372 .BR timer_create (2),
373 .BR sleep (3),
374 .BR usleep (3),
375 .BR time (7)