1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" References consulted:
24 .\" Linux libc source code
25 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
27 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified 2001-04-01 by aeb
29 .\" Modified 2003-07-23 by aeb
31 .\" Japanese Version Copyright (c) 1997 YOSHINO Takashi
32 .\" all rights reserved.
33 .\" Translated Mon Jan 20 18:47:50 JST 1997
34 .\" by YOSHINO Takashi <yoshino@civil.jcn.nihon-u.ac.jp>
35 .\" Updated Sat May 19 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
36 .\" Updated Mon Sep 1 JST 2003 by Kentaro Shirakata <argrath@ub32.org>
37 .\" Updated 2007-05-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.44
39 .TH USLEEP 3 2010-12-03 "" "Linux Programmer's Manual"
42 .\"O usleep \- suspend execution for interval of microseconds
43 usleep \- ¥Þ¥¤¥¯¥íÉÃñ°Ì¤Ç¼Â¹Ô¤ò±ä´ü¤¹¤ë
47 .B "#include <unistd.h>"
49 .BI "int usleep(useconds_t " usec );
53 .\"O Feature Test Macro Requirements for glibc (see
54 .\"O .BR feature_test_macros (7)):
55 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
56 .RB ( feature_test_macros (7)
65 .\"O Since glibc 2.12:
69 (_XOPEN_SOURCE\ >=\ 500 ||
70 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) &&
71 !(_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700)
74 .\"O Before glibc 2.12:
76 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
77 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
85 .\"O function suspends execution of the calling thread for
86 .\"O (at least) \fIusec\fP microseconds.
87 .\"O The sleep may be lengthened slightly
88 .\"O by any system activity or by the time spent processing the call or by the
89 .\"O granularity of system timers.
92 (¾¯¤Ê¤¯¤È¤â) \fIusec\fP¥Þ¥¤¥¯¥íÉäδ֡¢
93 ¸Æ¤Ó½Ð¤·¸µ¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤ò±ä´ü¤¹¤ë¡£
94 ¥·¥¹¥Æ¥à¤ÎÆ°ºî¾õ¶·¤ä¸Æ¤Ó½Ð¤·¤Ë¤è¤ë»þ´Ö¤Î¾ÃÈñ¤ä¥·¥¹¥Æ¥à¥¿¥¤¥Þ¤ÎγÅ٤ˤè¤Ã¤Æ¡¢
95 Ää»ß»þ´Ö¤ÏÀßÄꤷ¤¿Ãͤè¤ê¤â¾¯¤·±ä¤Ð¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
96 .\"O .SH "RETURN VALUE"
98 .\"O 0 on success, \-1 on error.
99 À®¸ù¤¹¤ë¤È 0¡¢¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤¹¡£
104 .\"O Interrupted by a signal; see
106 ¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤ÆÃæÃǤµ¤ì¤¿¡£
111 .\"O \fIusec\fP is not smaller than 1000000.
112 .\"O (On systems where that is considered an error.)
113 \fIusec\fP ¤¬ 1000000 °Ê¾å¤À¤Ã¤¿¡£
114 (¤³¤ì¤ò¥¨¥é¡¼¤È¤ß¤Ê¤¹¥·¥¹¥Æ¥à¤Î¤ß)
115 .\"O .SH "CONFORMING TO"
117 4.3BSD, POSIX.1-2001.
118 .\"O POSIX.1-2001 declares this function obsolete; use
119 .\"O .BR nanosleep (2)
121 POSIX.1-2001 ¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤Ï²áµî¤Î¤â¤Î¤ÈÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£
125 .\"O POSIX.1-2008 removes the specification of
129 ¤Îµ¬Ä꤬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£
131 .\"O On the original BSD implementation,
132 .\"O and in glibc before version 2.2.2, the return type of this function is
134 .\"O The POSIX version returns
136 .\"O and this is also the prototype used since glibc 2.2.2.
137 ¤â¤È¤â¤È¤Î BSD ¤Î¼ÂÁõ¤ä¡¢¥Ð¡¼¥¸¥ç¥ó 2.2.2 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢
138 ¤³¤Î´Ø¿ô¤ÎÊÖ¤êÃͤη¿¤Ï
143 ¤òÊÖ¤·¡¢¤³¤Î¥×¥í¥È¥¿¥¤¥×¤Ï glibc 2.2.2 °Ê¹ß¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£
147 .\"O error return is documented by SUSv2 and POSIX.1-2001.
151 SUSv2 ¤È POSIX.1-2001 ¤Ç¤Î¤ßʸ½ñ²½¤µ¤ì¤Æ¤¤¤ë¡£
156 .\"O is an unsigned integer type capable of holding integers
157 .\"O in the range [0,1000000].
158 .\"O Programs will be more portable
159 .\"O if they never mention this type explicitly.
162 ·¿¤Ï [0,1000000] ¤ÎÈϰϤÎÀ°¿ô¤ò°·¤¦¤³¤È¤¬¤Ç¤¤ë
163 Éä¹æ¤Ê¤·À°¿ô·¿¤Ç¤¢¤ë¡£
164 ÌÀ¼¨Åª¤Ë¤³¤Î·¿¤ò»È¤ï¤Ê¤¤¤³¤È¤Ç¥×¥í¥°¥é¥à¤Î°Ü¿¢À¤¬¤è¤ê¹â¤Þ¤ë¡£
165 °Ê²¼¤Î¤è¤¦¤Ë»È¤¦¤³¤È¡£
177 .\"O The interaction of this function with the
179 .\"O signal, and with other timer functions such as
182 .\"O .BR nanosleep (2),
183 .\"O .BR setitimer (2),
184 .\"O .BR timer_create (2),
185 .\"O .BR timer_delete (2),
186 .\"O .BR timer_getoverrun (2),
187 .\"O .BR timer_gettime (2),
188 .\"O .BR timer_settime (2),
198 .BR timer_create (2),
199 .BR timer_delete (2),
200 .BR timer_getoverrun (2),
201 .BR timer_gettime (2),
202 .BR timer_settime (2),
204 ¤È¤¤¤Ã¤¿¤½¤Î¾¤Î¥¿¥¤¥Þ¡¼´Ø¿ô¤òƱ»þ¤Ë»È¤Ã¤¿¾ì¹ç¤ÎÆ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£