OSDN Git Service

5112045117fdf3abb7866f7960cc800f5b5b1004
[linuxjm/LDP_man-pages.git] / draft / man2 / clock_nanosleep.2
1 .\" Copyright (c) 2008, 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 .\" Japanese Version Copyright (c) 2008  Akihiro MOTOKI
25 .\"         all rights reserved.
26 .\" Translated 2008-08-21, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.04
27 .\" 
28 .TH CLOCK_NANOSLEEP 2 2010-09-10 "Linux" "Linux Programmer's Manual"
29 .\"O .SH NAME
30 .SH Ì¾Á°
31 .\"O clock_nanosleep \- high-resolution sleep with specifiable clock
32 clock_nanosleep \- »ØÄꤷ¤¿¥¯¥í¥Ã¥¯¤Ç¤Î¹âÀºÅ٤ʼ¹ÔÄä»ß (sleep)
33 .\"O .SH SYNOPSIS
34 .SH ½ñ¼°
35 .B #include <time.h>
36 .nf
37 .sp
38 .BI "int clock_nanosleep(clockid_t " clock_id ", int " flags ,
39 .BI "                    const struct timespec *" request ,
40 .BI "                    struct timespec *" remain );
41 .fi
42 .sp
43 .\"O Link with \fI\-lrt\fP.
44 \fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
45 .sp
46 .ad l
47 .in -4n
48 .\"O Feature Test Macro Requirements for glibc (see
49 .\"O .BR feature_test_macros (7)):
50 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
51 .RB ( feature_test_macros (7)
52 »²¾È):
53 .in
54 .sp
55 .BR clock_nanosleep ():
56 .RS 4
57 _XOPEN_SOURCE\ >=\ 600 || _POSIX_C_SOURCE\ >=\ 200112L
58 .RE
59 .ad
60 .\"O .SH DESCRIPTION
61 .SH ÀâÌÀ
62 .\"O Like
63 .\"O .BR nanosleep (2),
64 .\"O .BR clock_nanosleep ()
65 .\"O allows the caller to sleep for an interval specified
66 .\"O with nanosecond precision.
67 .\"O It differs in allowing the caller to select the clock against
68 .\"O which the sleep interval is to be measured,
69 .\"O and in allowing the sleep interval to be specified as
70 .\"O either an absolute or a relative value.
71 .BR clock_nanosleep ()
72 ¤ò»È¤¦¤È¡¢
73 .BR nanosleep (2)
74 ƱÍÍ¡¢¥Ê¥ÎÉäÎÀºÅ٤ǻØÄꤵ¤ì¤¿´ü´Ö¤À¤±¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤ò
75 Ää»ß¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
76 .BR nanosleep (2)
77 ¤È°ã¤¦¤Î¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¤¬Ää»ß´ü´Ö¤ò¤É¤Î¥¯¥í¥Ã¥¯¤ËÂФ·¤Æ·×¬¤¹¤ë¤Î¤«¤òÁªÂò
78 ¤Ç¤­¤ëÅÀ¤È¡¢Ää»ß´ü´Ö¤òÀäÂÐÃͤǤâÁêÂÐÃͤǤâ»ØÄê¤Ç¤­¤ëÅÀ¤Ç¤¢¤ë¡£
79
80 .\"O The time values passed to and returned by this call are specified using
81 .\"O .I timespec
82 .\"O structures, defined as follows:
83 ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ·¤¿¤ê¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÊÖ¤·¤¿¤ê¤¹¤ë»þ´Ö¤ÎÃͤÏ
84 .I timespec
85 ¹½Â¤ÂΤò»È¤Ã¤Æ»ØÄꤵ¤ì¤ë¡£¤³¤Î¹½Â¤ÂΤÎÄêµÁ¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£
86 .sp
87 .in +4n
88 .nf
89 struct timespec {
90     time_t tv_sec;        /* seconds */
91     long   tv_nsec;       /* nanoseconds [0 .. 999999999] */
92 };
93 .fi
94 .in
95
96 .\"O The
97 .\"O .I clock_id
98 .\"O argument specifies the clock against which the sleep interval
99 .\"O is to be measured.
100 .\"O This argument can have one of the following values:
101 .I clock_id
102 °ú¤­¿ô¤Ç¡¢Ää»ß´ü´Ö¤ò¤É¤Î¥¯¥í¥Ã¥¯¤ËÂФ·¤Æ·×¬¤¹¤ë¤«¤ò»ØÄꤹ¤ë¡£
103 ¤³¤Î°ú¤­¿ô¤Ë¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«°ì¤Ä¤ò»ØÄê¤Ç¤­¤ë¡£
104 .TP 17
105 .BR CLOCK_REALTIME
106 .\"O A settable system-wide real-time clock.
107 ¥·¥¹¥Æ¥àÁ´ÂΤǻȤï¤ì¤ë¼Â»þ´Ö¥¯¥í¥Ã¥¯¡£
108 ¤³¤Î¥¯¥í¥Ã¥¯¤ÏÊѹ¹²Äǽ¤Ç¤¢¤ë¡£
109 .TP
110 .BR CLOCK_MONOTONIC
111 .\"O A nonsettable, monotonically increasing clock that measures time
112 .\"O since some unspecified point in the past that does not change after
113 .\"O system startup.
114 .\"O .\" On Linux this clock measures time since boot.
115 ²áµî¤Î¤¢¤ë»þÅÀ¤«¤é¤Î»þ´Ö¤ò·×¬¤¹¤ë¡¢Ã±Ä´Áý²Ã¤Î¥¯¥í¥Ã¥¯¡£
116 µ¯ÅÀ¤È¤Ê¤ë»þÅÀ¤Ï¥·¥¹¥Æ¥àµ¯Æ°¸å¤Ë¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£
117 ¤³¤Î¥¯¥í¥Ã¥¯¤ÏÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£
118 .\" Linux ¤Ç¤Ï¡¢¤³¤Î¥¯¥í¥Ã¥¯¤Ïµ¯Æ°¤«¤é¤Î»þ´Ö¤ò·×¬¤¹¤ë¡£
119 .TP
120 .BR CLOCK_PROCESS_CPUTIME_ID
121 .\"O A settable per-process clock that measures CPU time consumed
122 .\"O by all threads in the process.
123 ¤½¤Î¥×¥í¥»¥¹¤ÎÁ´¥¹¥ì¥Ã¥É¤Ç¾ÃÈñ¤µ¤ì¤ë CPU »þ´Ö¤ò·×¬¤¹¤ë¥×¥í¥»¥¹Ã±°Ì¤Î
124 ¥¯¥í¥Ã¥¯¡£¤³¤Î¥¯¥í¥Ã¥¯¤ÏÀßÄê²Äǽ¤Ç¤¢¤ë¡£
125 .\" There is some trickery between glibc and the kernel
126 .\" to deal with the CLOCK_PROCESS_CPUTIME_ID case.
127 .PP
128 .\"O See
129 .\"O .BR clock_getres (2)
130 .\"O for further details on these clocks.
131 ¤³¤ì¤é¤Î¥¯¥í¥Ã¥¯¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï
132 .BR clock_getres (2)
133 ¤ò»²¾È¡£
134
135 .\"O If
136 .\"O .I flags
137 .\"O is 0, then the value specified in
138 .\"O .I request
139 .\"O is interpreted as an interval relative to the current
140 .\"O value of the clock specified by
141 .\"O .IR clock_id .
142 .I flags
143 ¤¬ 0 ¤Î¾ì¹ç¡¢
144 .I request
145 ¤Ë»ØÄꤵ¤ì¤¿ÃͤÏ
146 .I clock_id
147 ¤Ç»ØÄꤵ¤ì¤¿¥¯¥í¥Ã¥¯¤Î¸½ºß¤ÎÃͤ«¤é¤ÎÁêÂÐŪ¤Ê´ü´Ö¤È²ò¼á¤µ¤ì¤ë¡£
148
149 .\"O If
150 .\"O .I flags
151 .\"O is
152 .\"O .BR TIMER_ABSTIME ,
153 .\"O then
154 .\"O .I request
155 .\"O is interpreted as an absolute time as measured by the clock,
156 .\"O .IR clock_id .
157 .\"O If
158 .\"O .I request
159 .\"O is less than or equal to the current value of the clock,
160 .\"O then
161 .\"O .BR clock_nanosleep ()
162 .\"O returns immediately without suspending the calling thread.
163 .I flags
164 ¤¬
165 .B TIMER_ABSTIME
166 ¤Î¾ì¹ç¡¢
167 .I request
168 ¤Ï»ØÄꤵ¤ì¤¿¥¯¥í¥Ã¥¯¤Ç·×¬¤µ¤ì¤ëÀäÂлþ¹ï¤È²ò¼á¤µ¤ì¤ë¡£
169 .I request
170 ¤¬»ØÄꤵ¤ì¤¿¥¯¥í¥Ã¥¯¤Î¸½ºß¤ÎÃͰʲ¼¤Î¾ì¹ç¡¢
171 .BR clock_nanosleep ()
172 ¤Ï¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤ÎÄä»ß¤ò¹Ô¤ï¤º¡¢¤¹¤°¤ËÊ֤롣
173
174 .\"O .BR clock_nanosleep ()
175 .\"O suspends the execution of the calling thread
176 .\"O until either at least the time specified by
177 .\"O .IR request
178 .\"O has elapsed,
179 .\"O or a signal is delivered that causes a signal handler to be called or
180 .\"O that terminates the process.
181 .BR clock_nanosleep ()
182 ¤Ï¡¢¾¯¤Ê¤¯¤È¤â
183 .I request
184 ¤Ç»ØÄꤵ¤ì¤¿»þ´Ö¤¬·Ð²á¤¹¤ë¤Þ¤Ç¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤òÄä»ß¤¹¤ë¡£
185 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¤ê¡¢¤½¤Î¥×¥í¥»¥¹¤ò½ªÎ»¤µ¤»¤ë¤è¤¦¤Ê
186 ¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤¿¤ê¤·¤¿¾ì¹ç¤Ë¤â¡¢¥¹¥ì¥Ã¥É¤Î¼Â¹ÔÄä»ß¤Ï½ªÎ»¤¹¤ë¡£
187
188 .\"O If the call is interrupted by a signal handler,
189 .\"O .BR clock_nanosleep ()
190 .\"O fails with the error
191 .\"O .BR EINTR .
192 .\"O In addition, if
193 .\"O .I remain
194 .\"O is not NULL, and
195 .\"O .I flags
196 .\"O was not
197 .\"O .BR TIMER_ABSTIME ,
198 .\"O it returns the remaining unslept time in
199 .\"O .IR remain .
200 .\"O This value can then be used to call
201 .\"O .BR clock_nanosleep ()
202 .\"O again and complete a (relative) sleep.
203 ¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¾ì¹ç¡¢
204 .BR clock_nanosleep ()
205 ¤Ï¥¨¥é¡¼
206 .B EINTR
207 ¤Ç¼ºÇÔ¤¹¤ë¡£¤µ¤é¤Ë¡¢
208 .I remain
209 ¤¬ NULL ¤Ç¤Ê¤¯¡¢¤«¤Ä
210 .I flags
211 ¤¬
212 .B TIMER_ABSTIME
213 ¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢
214 .I remain
215 ¤Ë»Ä¤ê¤ÎÄä»ß»þ´Ö¤¬ÊÖ¤µ¤ì¤ë¡£
216 ¤³¤ÎÃͤò»È¤Ã¤Æ
217 .BR clock_nanosleep ()
218 ¤òºÆÅٸƤӽФ¹¤³¤È¤Ç¡¢(ÁêÂÐŪ¤Ê´ü´Ö¤Î) Ää»ß¤ò´°Î»¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
219 .\"O .SH "RETURN VALUE"
220 .SH ÊÖ¤êÃÍ
221 .\"O On successfully sleeping for the requested interval,
222 .\"O .BR clock_nanosleep ()
223 .\"O returns 0.
224 .\"O If the call is interrupted by a signal handler or encounters an error,
225 .\"O then it returns one of the positive error number listed in ERRORS.
226 Í׵ᤵ¤ì¤¿´ü´Ö¤ÎÄä»ß¤ËÀ®¸ù¤¹¤ë¤È¡¢
227 .BR clock_nanosleep ()
228 ¤Ï 0 ¤òÊÖ¤¹¡£
229 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ç³ä¤ê¹þ¤Þ¤ì¤¿¤ê¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤ê¤·¤¿¾ì¹ç¡¢
230 ¡Ö¥¨¥é¡¼¡×¤ÎÀá¤Î¥ê¥¹¥È¤Ë¤¢¤ëÀµ¤Î¥¨¥é¡¼ÈÖ¹æ¤Î¤¤¤º¤ì¤«°ì¤Ä¤òÊÖ¤¹¡£
231 .\"O .SH ERRORS
232 .SH ¥¨¥é¡¼
233 .TP
234 .B EFAULT
235 .\"O .I request
236 .\"O or
237 .\"O .I remain
238 .\"O specified an invalid address.
239 .I request
240 ¤ä
241 .I remain
242 ¤Ë̵¸ú¤Ê¥¢¥É¥ì¥¹¤¬»ØÄꤵ¤ì¤¿¡£
243 .TP
244 .B EINTR
245 .\"O The sleep was interrupted by a signal handler.
246 Ää»ß¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¡£
247 .TP
248 .B EINVAL
249 .\"O The value in the
250 .\"O .I tv_nsec
251 .\"O field was not in the range 0 to 999999999 or
252 .\"O .I tv_sec
253 .\"O was negative.
254 .I tv_nsec
255 ¥Õ¥£¡¼¥ë¥É¤ÎÃͤ¬ 0 ¤«¤é 999999999 ¤ÎÈϰϤǤʤ¤¤«¡¢
256 .I tv_sec
257 ¤ÎÃͤ¬Éé¤Ç¤¢¤Ã¤¿¡£
258 .TP
259 .B EINVAL
260 .\"O .I clock_id
261 .\"O was invalid.
262 .\"O .RB ( CLOCK_THREAD_CPUTIME_ID
263 .\"O is not a permitted value for
264 .\"O .IR clock_id .)
265 .I clock_id
266 ¤¬Ìµ¸ú¤Ç¤¢¤Ã¤¿
267 .RB ( CLOCK_THREAD_CPUTIME_ID
268 ¤¬
269 .I clock_id
270 ¤È¤·¤ÆÍ­¸ú¤ÊÃͤǤϤʤ¤)¡£
271 .\"O .SH VERSIONS
272 .SH ¥Ð¡¼¥¸¥ç¥ó
273 .\"O The
274 .\"O .BR clock_nanosleep ()
275 .\"O system call first appeared in Linux 2.6.
276 .\"O Support is available in glibc since version 2.1.
277 .BR clock_nanosleep ()
278 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.6 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
279 glibc ¤Ç¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£
280 .\"O .SH "CONFORMING TO"
281 .SH ½àµò
282 POSIX.1-2001.
283 .\"O .SH NOTES
284 .SH Ãí°Õ
285 .\"O If the interval specified in
286 .\"O .I request
287 .\"O is not an exact multiple of the granularity underlying clock (see
288 .\"O .BR time (7)),
289 .\"O then the interval will be rounded up to the next multiple.
290 .\"O Furthermore, after the sleep completes, there may still be a delay before
291 .\"O the CPU becomes free to once again execute the calling thread.
292 .I request
293 ¤Ç»ØÄꤵ¤ì¤¿Ää»ß´ü´Ö¤¬¡¢»þ´Ö¤Î·×¬¤Ë»ÈÍѤµ¤ì¤ë¥¯¥í¥Ã¥¯
294 .RB ( time (7)
295 »²¾È) ¤ÎÀºÅÙ¤ÎÇÜ¿ô¤Á¤ç¤¦¤É¤Ç¤Ê¤¤¾ì¹ç¡¢Ää»ß´ü´Ö¤Ï°ìÈֶᤤ¼¡¤ÎÇÜ¿ô¤Ë
296 ÀÚ¤ê¾å¤²¤é¤ì¤ë¡£¤µ¤é¤Ë¡¢Ää»ß¤¬´°Î»¤·¤¿¸å¤Ë¡¢CPU ¤¬¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤ò
297 ¤â¤¦°ìÅټ¹ԤǤ­¤ë¤è¤¦¤Ë¤Ê¤ë¤Þ¤Ç¤Ë¤Ï¡¢Ãٱ䤬Æþ¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
298
299 .\"O Using an absolute timer is useful for preventing
300 .\"O timer drift problems of the type described in
301 .\"O .BR nanosleep (2).
302 .\"O (Such problems are exacerbated in programs that try to restart
303 .\"O a relative sleep that is repeatedly interrupted by signals.)
304 ÀäÂÐÃÍ»ØÄê¤Î¥¿¥¤¥Þ¤ò»È¤¦¤Î¤Ï¡¢
305 .BR nanosleep (2)
306 ¤Ë½ñ¤«¤ì¤Æ¤¤¤ëÎà¤Î¥¿¥¤¥Þ¤Î¤º¤ì¤ÎÌäÂê¤òËɻߤ¹¤ë¤Î¤ËÌòΩ¤Ä
307 (¤³¤Î¼ï¤ÎÌäÂê¤Ï¡¢¥·¥°¥Ê¥ë¤Ë³ä¤ê¹þ¤Þ¤ì¤¿ºÝ¤ËÁêÂлØÄê¤ÎÄä»ß¤ò
308 ·«¤êÊÖ¤·ºÆ³«¤·¤è¤¦¤È¤¹¤ë¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¤«¤¨¤Ã¤Æ°­²½¤¹¤ë)¡£
309 .\"O To perform a relative sleep that avoids these problems, call
310 .\"O .BR clock_gettime (2)
311 .\"O for the desired clock,
312 .\"O add the desired interval to the returned time value,
313 .\"O and then call
314 .\"O .BR clock_nanosleep ()
315 .\"O with the
316 .\"O .B TIMER_ABSTIME
317 .\"O flag.
318 ¤³¤ì¤é¤ÎÌäÂê¤ò²óÈò¤·¤ÆÁêÂлØÄê¤ÎÄä»ß¤ò¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢
319 ´õ˾¤¹¤ë¥¯¥í¥Ã¥¯¤Ç
320 .BR clock_gettime (2)
321 ¤ò¸Æ¤Ó½Ð¤·¡¢¤½¤ÎÊÖ¤êÃͤλþ¹ïÃͤ˴õ˾¤¹¤ë´ü´Ö¤ò²Ã»»¤·¤Æ¤«¤é¡¢
322 .B TIMER_ABSTIME
323 ¥Õ¥é¥°¤ò»ØÄꤷ¤Æ
324 .BR clock_nanosleep ()
325 ¤ò¸Æ¤Ó½Ð¤¹¡£
326
327 .\"O .BR clock_nanosleep ()
328 .\"O is never restarted after being interrupted by a signal handler,
329 .\"O regardless of the use of the
330 .\"O .BR sigaction (2)
331 .\"O .B SA_SIGACTION
332 .\"O flag.
333 .BR sigaction (2)
334 ¤Ç
335 .BR SA_RESTART
336 ¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤«¤Ë´Ø¤ï¤é¤º¡¢
337 ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤ê³ä¤ê¹þ¤Þ¤ì¤¿¸å¤Ë
338 .BR clock_nanosleep ()
339 ¤¬ºÆ³«¤µ¤ì¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£
340
341 .\"O The
342 .\"O .I remain
343 .\"O argument is unused, and unnecessary, when
344 .\"O .I flags
345 .\"O is
346 .\"O .BR TIMER_ABSTIME .
347 .\"O (An absolute sleep can be restarted using the same
348 .\"O .I request
349 .\"O argument.)
350 .I flags
351 ¤¬
352 .B TIMER_ABSTIME
353 ¤Î¾ì¹ç¡¢
354 .I remain
355 °ú¤­¿ô¤Ï»ÈÍѤµ¤ì¤º¡¢ÉÔÍפǤ¢¤ë
356 (ÀäÂÐÃͤǤÎÄä»ß¤Ç¤Ï¡¢Æ±¤¸
357 .I request
358 °ú¤­¿ô¤ò»È¤Ã¤ÆºÆÅٸƤӽФ¹¤³¤È¤¬¤Ç¤­¤ë)¡£
359
360 .\"O POSIX.1 specifies that
361 .\"O .BR clock_nanosleep ()
362 .\"O has no effect on signals dispositions or the signal mask.
363 POSIX.1 ¤Îµ¬Äê¤Ç¤Ï¡¢
364 .BR clock_nanosleep ()
365 ¤Ï¥·¥°¥Ê¥ë¤Î½èÍýÊýË¡¤ä¥·¥°¥Ê¥ë¥Þ¥¹¥¯¤Ë±Æ¶Á¤òÍ¿¤¨¤Ê¤¤¡¢¤È¤µ¤ì¤Æ¤¤¤ë¡£
366
367 .\"O POSIX.1 specifies that after changing the value of the
368 .\"O .B CLOCK_REALTIME
369 .\"O clock via
370 .\"O .BR clock_settime (2),
371 .\"O the new clock value shall be used to determine the time
372 .\"O at which a thread blocked on an absolute
373 .\"O .BR clock_nanosleep ()
374 .\"O will wake up;
375 .\"O if the new clock value falls past the end of the sleep interval, then the
376 .\"O .BR clock_nanosleep ()
377 .\"O call will return immediately.
378 POSIX.1 ¤Îµ¬Äê¤Ç¤Ï¡¢
379 .BR clock_settime (2)
380 ¤Ç
381 .B CLOCK_REALTIME
382 ¥¯¥í¥Ã¥¯¤ÎÃͤòÊѹ¹¤·¤¿¸å¤Ï¡¢ÀäÂÐÃÍ»ØÄê¤Î
383 .BR clock_nanosleep ()
384 ¤ÇÄä»ß¤·¤Æ¤¤¤ë¥¹¥ì¥Ã¥É¤òµ¯Æ°¤µ¤»¤ë»þ¹ï¤ÎȽÄê¤Ï¡¢
385 ¿·¤·¤¤¥¯¥í¥Ã¥¯Ãͤò»È¤Ã¤Æ¹Ô¤ï¤ì¤ë¡¢¤È¤µ¤ì¤Æ¤¤¤ë¡£
386 ¿·¤·¤¤¥¯¥í¥Ã¥¯Ãͤˤª¤¤¤ÆÄä»ß´ü´Ö¤Î½ªÎ»»þ¹ï¤¬²áµî¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢
387 .BR clock_nanosleep ()
388 ¤Ï¤¹¤°¤ËÊ֤뤳¤È¤Ë¤Ê¤ë¡£
389
390 .\"O POSIX.1 specifies that
391 .\"O changing the value of the
392 .\"O .B CLOCK_REALTIME
393 .\"O clock via
394 .\"O .BR clock_settime (2)
395 .\"O shall have no effect on a thread that is blocked on a relative
396 .\"O .BR clock_nanosleep ().
397 POSIX.1 ¤Îµ¬Äê¤Ç¤Ï¡¢
398 .BR clock_settime (2)
399 ¤Ç
400 .B CLOCK_REALTIME
401 ¥¯¥í¥Ã¥¯¤ÎÃͤòÊѹ¹¤·¤Æ¤â¡¢ÁêÂÐÃÍ»ØÄê¤Î
402 .BR clock_nanosleep ()
403 ¤ÇÄä»ß¤·¤Æ¤¤¤ë¥¹¥ì¥Ã¥É¤Ë¤Ï±Æ¶Á¤òÍ¿¤¨¤Ê¤¤¡¢¤È¤µ¤ì¤Æ¤¤¤ë¡£
404 .\"O .SH "SEE ALSO"
405 .SH ´ØÏ¢¹àÌÜ
406 .BR clock_getres (2),
407 .BR nanosleep (2),
408 .BR timer_create (2),
409 .BR sleep (3),
410 .BR usleep (3),
411 .BR time (7)