OSDN Git Service

(split) LDP: Update release pages.
[linuxjm/LDP_man-pages.git] / release / 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 .\"*******************************************************************
32 .\"
33 .\" This file was generated with po4a. Translate the source file.
34 .\"
35 .\"*******************************************************************
36 .TH USLEEP 3 2010\-12\-03 "" "Linux Programmer's Manual"
37 .SH 名前
38 usleep \- マイクロ秒単位で実行を延期する
39 .SH 書式
40 .nf
41 \fB#include <unistd.h>\fP
42 .sp
43 \fBint usleep(useconds_t \fP\fIusec\fP\fB);\fP
44 .fi
45 .sp
46 .in -4n
47 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
48 .in
49 .sp
50 \fBusleep\fP():
51 .ad l
52 .RS 4
53 .PD 0
54 .TP  4
55 glibc 2.12 以降:
56 .nf
57 _BSD_SOURCE ||
58     (_XOPEN_SOURCE\ >=\ 500 ||
59         _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) &&
60     !(_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700)
61 .TP  4
62 .fi
63 glibc 2.12 より前: _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
64 .PD
65 .RE
66 .ad b
67 .SH 説明
68 \fBusleep\fP()  関数は (少なくとも) \fIusec\fPマイクロ秒の間、 呼び出し元スレッドの実行を延期する。
69 システムの動作状況や呼び出しによる時間の消費やシステムタイマの粒度によって、 停止時間は設定した値よりも少し延ばされるかもしれない。
70 .SH 返り値
71 成功すると 0、エラーの場合 \-1 を返す。
72 .SH エラー
73 .TP 
74 \fBEINTR\fP
75 シグナルによって中断された。 \fBsignal\fP(7)  参照。
76 .TP 
77 \fBEINVAL\fP
78 \fIusec\fP が 1000000 以上だった。 (これをエラーとみなすシステムのみ)
79 .SH 準拠
80 4.3BSD, POSIX.1\-2001.  POSIX.1\-2001 では、この関数は過去のものと宣言されている。 代わりに
81 \fBnanosleep\fP(2)  を使うこと。 POSIX.1\-2008 では、 \fBusleep\fP()  の規定が削除されている。
82
83 もともとの BSD の実装や、バージョン 2.2.2 より前の glibc では、 この関数の返り値の型は \fIvoid\fP である。 POSIX 版は
84 \fIint\fP を返し、このプロトタイプは glibc 2.2.2 以降で使用されている。
85
86 エラーとして \fBEINVAL\fP を返すというのは SUSv2 と POSIX.1\-2001 でのみ文書化されている。
87 .SH 注意
88 \fIuseconds_t\fP 型は [0,1000000] の範囲の整数を扱うことができる 符号なし整数型である。
89 明示的にこの型を使わないことでプログラムの移植性がより高まる。 以下のように使うこと。
90 .in +4n
91 .nf
92 .sp
93 #include <unistd.h>
94 \&...
95     unsigned int usecs;
96 \&...
97     usleep(usecs);
98 .fi
99 .in
100 .LP
101 この関数と、 \fBSIGALRM\fP シグナルあるいは \fBalarm\fP(2), \fBsleep\fP(3), \fBnanosleep\fP(2),
102 \fBsetitimer\fP(2), \fBtimer_create\fP(2), \fBtimer_delete\fP(2),
103 \fBtimer_getoverrun\fP(2), \fBtimer_gettime\fP(2), \fBtimer_settime\fP(2),
104 \fBualarm\fP(3)  といったその他のタイマー関数を同時に使った場合の動作は未定義である。
105 .SH 関連項目
106 \fBalarm\fP(2), \fBgetitimer\fP(2), \fBnanosleep\fP(2), \fBselect\fP(2),
107 \fBsetitimer\fP(2), \fBsleep\fP(3), \fBualarm\fP(3), \fBtime\fP(7)
108 .SH この文書について
109 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.41 の一部
110 である。プロジェクトの説明とバグ報告に関する情報は
111 http://www.kernel.org/doc/man\-pages/ に書かれている。