OSDN Git Service

bb6f83cace780e4ede244834d3769622de048a31
[linuxjm/LDP_man-pages.git] / release / man3 / ualarm.3
1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\"
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
13 .\"
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 .\" GNU General Public License for more details.
18 .\"
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, see
21 .\" <http://www.gnu.org/licenses/>.
22 .\" %%%LICENSE_END
23 .\"
24 .\"*******************************************************************
25 .\"
26 .\" This file was generated with po4a. Translate the source file.
27 .\"
28 .\"*******************************************************************
29 .TH UALARM 3 2013\-04\-18 "" "Linux Programmer's Manual"
30 .SH 名前
31 ualarm \- 指定したマイクロ秒後にシグナルを送る予定をする
32 .SH 書式
33 .nf
34 \fB#include <unistd.h>\fP
35 .sp
36 \fBuseconds_t ualarm(useconds_t \fP\fIusecs\fP\fB, useconds_t \fP\fIinterval\fP\fB);\fP
37 .fi
38 .sp
39 .in -4n
40 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
41 .in
42 .sp
43 \fBualarm\fP():
44 .ad l
45 .RS 4
46 .PD 0
47 .TP  4
48 glibc 2.12 以降:
49 .nf
50 _BSD_SOURCE ||
51     (_XOPEN_SOURCE\ >=\ 500 ||
52         _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) &&
53     !(_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700)
54 .TP  4
55 .fi
56 glibc 2.12 より前: _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
57 .PD
58 .RE
59 .ad b
60 .SH 説明
61 \fBualarm\fP()  関数は、呼び出し元のプロセスに対して \fIusecs\fP マイクロ秒 (以上) 後に \fBSIGALRM\fP シグナルを送る。
62 遅れはシステムの活性度・呼び出しの処理時間・ システムタイマーの粒度によって長くなるかもしれない。
63 .LP
64 捕捉または無視されない限り、 \fBSIGALRM\fP シグナルはプロセスを終了させる。
65 .LP
66 \fIinterval\fP 引き数が 0 でない場合、最初の \fBSIGALRM\fP シグナルの後、 さらに \fIinterval\fP マイクロ秒毎に
67 SIGALRM シグナルが送られる。
68 .SH 返り値
69 この関数は、過去に設定された alarm の残りマイクロ秒数を返す。 実行中の alarm がない場合は 0 を返す。
70 .SH エラー
71 .TP 
72 \fBEINTR\fP
73 シグナルによって割り込まれた。
74 .TP 
75 \fBEINVAL\fP
76 \fIusecs\fP または \fIinterval\fP が 1000000 未満でない (これがエラーとして扱われるシステムの場合)。
77 .SH 準拠
78 4.3BSD, POSIX.1\-2001.  POSIX.1\-2001 では \fBualarm\fP()  は過去のものとされている。
79 POSIX.1\-2008 では、 \fBualarm\fP()  の仕様が削除されている。 4.3BSD, SUSv2, POSIX
80 はエラーを定義していない。
81 .SH 注意
82 .\" This case is not documented in HP-US, Solar, FreeBSD, NetBSD, or OpenBSD!
83 POSIX.1\-2001 では、 \fIusecs\fP 引き数が 0 の場合、何が起こるかは規定されていない。 Linux
84 (やおそらく他ほとんどのシステム) では、 \fIusecs\fP 引き数が 0 の場合、処理待ちのアラームがキャンセルされる。
85
86 \fIuseconds_t\fP 型は [0,1000000] の範囲の整数を保持できる符号なし整数型である。 もともとの BSD での実装や、バージョン
87 2.1 より前の glibc では、 \fBualarm\fP()  の引き数の型は \fIunsigned int\fP であった。 プログラム中に明示的に
88 \fIuseconds_t\fP と書かない方が、移植性が高くなる。
89 .LP
90 この関数と \fBalarm\fP(2), \fBsleep\fP(3), \fBnanosleep\fP(2), \fBsetitimer\fP(2),
91 \fBtimer_create\fP(2), \fBtimer_delete\fP(2), \fBtimer_getoverrun\fP(2),
92 \fBtimer_gettime\fP(2), \fBtimer_settime\fP(2), \fBusleep\fP(3)
93 のような他のタイマー関数との相互作用は規定されていない。
94 .LP
95 この関数は廃止予定である。 代わりに \fBsetitimer\fP(2)  もしくは POSIX インターバルタイマ (\fBtimer_create\fP(2)
96 など) を使うこと。
97 .SH 関連項目
98 \fBalarm\fP(2), \fBgetitimer\fP(2), \fBnanosleep\fP(2), \fBselect\fP(2),
99 \fBsetitimer\fP(2), \fBusleep\fP(3), \fBtime\fP(7)
100 .SH この文書について
101 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
102 である。プロジェクトの説明とバグ報告に関する情報は
103 http://www.kernel.org/doc/man\-pages/ に書かれている。