OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / usleep.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
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.
6 .\"
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.
11 .\"
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
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
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
30 .\"
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
38 .\"
39 .TH USLEEP 3  2007-07-26 "" "Linux Programmer's Manual"
40 .\"O .SH NAME
41 .SH Ì¾Á°
42 .\"O usleep \- suspend execution for interval of microseconds
43 usleep \- ¥Þ¥¤¥¯¥íÉÃñ°Ì¤Ç¼Â¹Ô¤ò±ä´ü¤¹¤ë
44 .\"O .SH SYNOPSIS
45 .SH ½ñ¼°
46 .nf
47 .B "#include <unistd.h>"
48 .sp
49 .BI "int usleep(useconds_t " usec );
50 .fi
51 .sp
52 .in -4n
53 .\"O Feature Test Macro Requirements for glibc (see
54 .\"O .BR feature_test_macros (7)):
55 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
56 .RB ( feature_test_macros (7)
57 »²¾È):
58 .in
59 .sp
60 .BR usleep ():
61 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500
62 .\"O .SH DESCRIPTION
63 .SH ÀâÌÀ
64 .\"O  The
65 .\"O .BR usleep ()
66 .\"O function suspends execution of the calling process for
67 .\"O (at least) \fIusec\fP microseconds.
68 .\"O The sleep may be lengthened slightly
69 .\"O by any system activity or by the time spent processing the call or by the
70 .\"O granularity of system timers.
71 .BR usleep ()
72 ´Ø¿ô¤Ï
73 (¾¯¤Ê¤¯¤È¤â) \fIusec\fP¥Þ¥¤¥¯¥íÉäδ֡¢
74 ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¹Ô¤ò±ä´ü¤¹¤ë¡£
75 ¥·¥¹¥Æ¥à¤ÎÆ°ºî¾õ¶·¤ä¸Æ¤Ó½Ð¤·¤Ë¤è¤ë»þ´Ö¤Î¾ÃÈñ¤ä¥·¥¹¥Æ¥à¥¿¥¤¥Þ¤ÎγÅ٤ˤè¤Ã¤Æ¡¢
76 Ää»ß»þ´Ö¤ÏÀßÄꤷ¤¿Ãͤè¤ê¤â¾¯¤·±ä¤Ð¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
77 .\"O .SH "RETURN VALUE"
78 .SH ÊÖ¤êÃÍ
79 .\"O 0 on success, \-1 on error.
80 À®¸ù¤¹¤ë¤È 0¡¢¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤¹¡£
81 .\"O .SH ERRORS
82 .SH ¥¨¥é¡¼
83 .TP
84 .B EINTR
85 .\"O Interrupted by a signal; see
86 .\"O .BR signal (7).
87 ¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤ÆÃæÃǤµ¤ì¤¿¡£
88 .BR signal (7)
89 »²¾È¡£
90 .TP
91 .B EINVAL
92 .\"O \fIusec\fP is not smaller than 1000000.
93 .\"O (On systems where that is considered an error.)
94 \fIusec\fP ¤¬ 1000000 °Ê¾å¤À¤Ã¤¿¡£
95 (¤³¤ì¤ò¥¨¥é¡¼¤È¤ß¤Ê¤¹¥·¥¹¥Æ¥à¤Î¤ß)
96 .\"O .SH "CONFORMING TO"
97 .SH ½àµò
98 4.3BSD, POSIX.1-2001.
99 .\"O POSIX.1-2001 declares this function obsolete; use
100 .\"O .BR nanosleep (2)
101 .\"O instead.
102 POSIX.1-2001 ¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤Ï²áµî¤Î¤â¤Î¤ÈÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£
103 Âå¤ï¤ê¤Ë
104 .BR nanosleep (2)
105 ¤ò»È¤¦¤³¤È¡£
106 .\"O POSIX.1-2008 removes the specification of
107 .\"O .BR usleep ().
108 POSIX.1-2008 ¤Ç¤Ï¡¢
109 .BR usleep ()
110 ¤Îµ¬Ä꤬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£
111
112 .\"O On the original BSD implementation,
113 .\"O and in glibc before version 2.2.2, the return type of this function is
114 .\"O .IR void .
115 .\"O The POSIX version returns
116 .\"O .IR int ,
117 .\"O and this is also the prototype used since glibc 2.2.2.
118 ¤â¤È¤â¤È¤Î BSD ¤Î¼ÂÁõ¤ä¡¢¥Ð¡¼¥¸¥ç¥ó 2.2.2 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢
119 ¤³¤Î´Ø¿ô¤ÎÊÖ¤êÃͤη¿¤Ï
120 .I void
121 ¤Ç¤¢¤ë¡£
122 POSIX ÈǤÏ
123 .I int
124 ¤òÊÖ¤·¡¢¤³¤Î¥×¥í¥È¥¿¥¤¥×¤Ï glibc 2.2.2 °Ê¹ß¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£
125
126 .\"O Only the
127 .\"O .B EINVAL
128 .\"O error return is documented by SUSv2 and POSIX.1-2001.
129 ¥¨¥é¡¼¤È¤·¤Æ
130 .B EINVAL
131 ¤òÊÖ¤¹¤È¤¤¤¦¤Î¤Ï
132 SUSv2 ¤È POSIX.1-2001 ¤Ç¤Î¤ßʸ½ñ²½¤µ¤ì¤Æ¤¤¤ë¡£
133 .\"O .SH NOTES
134 .SH Ãí°Õ
135 .\"O The type
136 .\"O .I useconds_t
137 .\"O is an unsigned integer type capable of holding integers
138 .\"O in the range [0,1000000].
139 .\"O Programs will be more portable
140 .\"O if they never mention this type explicitly.
141 .\"O Use
142 .I useconds_t
143 ·¿¤Ï [0,1000000] ¤ÎÈϰϤÎÀ°¿ô¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤ë
144 Éä¹æ¤Ê¤·À°¿ô·¿¤Ç¤¢¤ë¡£
145 ÌÀ¼¨Åª¤Ë¤³¤Î·¿¤ò»È¤ï¤Ê¤¤¤³¤È¤Ç¥×¥í¥°¥é¥à¤Î°Ü¿¢À­¤¬¤è¤ê¹â¤Þ¤ë¡£
146 °Ê²¼¤Î¤è¤¦¤Ë»È¤¦¤³¤È¡£
147 .in +4n
148 .nf
149 .sp
150 #include <unistd.h>
151 \&...
152     unsigned int usecs;
153 \&...
154     usleep(usecs);
155 .fi
156 .in
157 .LP
158 .\"O The interaction of this function with the
159 .\"O .B SIGALRM
160 .\"O signal, and with other timer functions such as
161 .\"O .BR alarm (2),
162 .\"O .BR sleep (3),
163 .\"O .BR nanosleep (2),
164 .\"O .BR setitimer (2),
165 .\"O .BR timer_create (2),
166 .\"O .BR timer_delete (2),
167 .\"O .BR timer_getoverrun (2),
168 .\"O .BR timer_gettime (2),
169 .\"O .BR timer_settime (2),
170 .\"O .BR ualarm (3)
171 .\"O is unspecified.
172 ¤³¤Î´Ø¿ô¤È¡¢
173 .B SIGALRM
174 ¥·¥°¥Ê¥ë¤¢¤ë¤¤¤Ï
175 .BR alarm (2),
176 .BR sleep (3),
177 .BR nanosleep (2),
178 .BR setitimer (2),
179 .BR timer_create (2),
180 .BR timer_delete (2),
181 .BR timer_getoverrun (2),
182 .BR timer_gettime (2),
183 .BR timer_settime (2),
184 .BR ualarm (3)
185 ¤È¤¤¤Ã¤¿¤½¤Î¾¤Î¥¿¥¤¥Þ¡¼´Ø¿ô¤òƱ»þ¤Ë»È¤Ã¤¿¾ì¹ç¤ÎÆ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£
186 .\"O .SH "SEE ALSO"
187 .SH ´ØÏ¢¹àÌÜ
188 .BR alarm (2),
189 .BR getitimer (2),
190 .BR nanosleep (2),
191 .BR select (2),
192 .BR setitimer (2),
193 .BR sleep (3),
194 .BR ualarm (3),
195 .BR time (7)