.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) .\" .\" %%%LICENSE_START(GPLv2+_DOC_FULL) .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, see .\" . .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2004 Yuichi SATO .\" all rights reserved. .\" Translated Sat Sep 11 07:32:05 JST 2004 .\" by Yuichi SATO .\" Updated 2007-05-04, Akihiro MOTOKI .\" Updated 2013-05-01, Akihiro MOTOKI .\" .TH UALARM 3 2017\-09\-15 "" "Linux Programmer's Manual" .SH 名前 ualarm \- 指定したマイクロ秒後にシグナルを送る予定をする .SH 書式 .nf \fB#include \fP .PP \fBuseconds_t ualarm(useconds_t \fP\fIusecs\fP\fB, useconds_t \fP\fIinterval\fP\fB);\fP .fi .PP .RS -4 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .RE .PP \fBualarm\fP(): .ad l .RS 4 .PD 0 .TP 4 glibc 2.12 以降: .nf (_XOPEN_SOURCE\ >=\ 500) && ! (_POSIX_C_SOURCE\ >=\ 200809L) || /* Glibc 2.19 以降: */ _DEFAULT_SOURCE || /* Glibc 2.19 以前: */ _BSD_SOURCE .fi .TP 4 glibc 2.12 より前: .\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 .PD .RE .ad b .SH 説明 \fBualarm\fP() 関数は、呼び出し元のプロセスに対して \fIusecs\fP マイクロ秒 (以上) 後に \fBSIGALRM\fP シグナルを送る。 遅れはシステムの活性度・呼び出しの処理時間・ システムタイマーの粒度によって長くなるかもしれない。 .PP 捕捉または無視されない限り、 \fBSIGALRM\fP シグナルはプロセスを終了させる。 .PP \fIinterval\fP 引数が 0 でない場合、最初の \fBSIGALRM\fP シグナルの後、 さらに \fIinterval\fP マイクロ秒毎に SIGALRM シグナルが送られる。 .SH 返り値 この関数は、過去に設定された alarm の残りマイクロ秒数を返す。 実行中の alarm がない場合は 0 を返す。 .SH エラー .TP \fBEINTR\fP シグナルによって中断された。 \fBsignal\fP(7) 参照。 .TP \fBEINVAL\fP \fIusecs\fP または \fIinterval\fP が 1000000 未満でない (これがエラーとして扱われるシステムの場合)。 .SH 属性 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lb lb lb l l l. インターフェース 属性 値 T{ \fBualarm\fP() T} Thread safety MT\-Safe .TE .SH 準拠 4.3BSD, POSIX.1\-2001. POSIX.1\-2001 では \fBualarm\fP() は過去のものとされている。 POSIX.1\-2008 では、 \fBualarm\fP() の仕様が削除されている。 4.3BSD, SUSv2, POSIX はエラーを定義していない。 .SH 注意 .\" This case is not documented in HP-US, Solar, FreeBSD, NetBSD, or OpenBSD! POSIX.1\-2001 では、 \fIusecs\fP 引数が 0 の場合、何が起こるかは規定されていない。 Linux (やおそらく他ほとんどのシステム) では、 \fIusecs\fP 引数が 0 の場合、処理待ちのアラームがキャンセルされる。 .PP \fIuseconds_t\fP 型は [0,1000000] の範囲の整数を保持できる符号なし整数型である。 もともとの BSD での実装や、バージョン 2.1 より前の glibc では、 \fBualarm\fP() の引数の型は \fIunsigned int\fP であった。 プログラム中に明示的に \fIuseconds_t\fP と書かない方が、移植性が高くなる。 .PP この関数と \fBalarm\fP(2), \fBsleep\fP(3), \fBnanosleep\fP(2), \fBsetitimer\fP(2), \fBtimer_create\fP(2), \fBtimer_delete\fP(2), \fBtimer_getoverrun\fP(2), \fBtimer_gettime\fP(2), \fBtimer_settime\fP(2), \fBusleep\fP(3) のような他のタイマー関数との相互作用は規定されていない。 .PP この関数は廃止予定である。 代わりに \fBsetitimer\fP(2) もしくは POSIX インターバルタイマー (\fBtimer_create\fP(2) など) を使うこと。 .SH 関連項目 \fBalarm\fP(2), \fBgetitimer\fP(2), \fBnanosleep\fP(2), \fBselect\fP(2), \fBsetitimer\fP(2), \fBusleep\fP(3), \fBtime\fP(7) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。