.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) .\" .\" 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, write to the Free .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. .\" .\" 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 .\" .TH UALARM 3 2010-09-20 "" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O ualarm \- schedule signal after given number of microseconds ualarm \- 指定したマイクロ秒後にシグナルを送る予定をする .\"O .SH SYNOPSIS .SH 書式 .nf .B "#include " .sp .BI "useconds_t ualarm(useconds_t " usecs ", useconds_t " interval ); .fi .sp .in -4n .\"O Feature Test Macro Requirements for glibc (see .\"O .BR feature_test_macros (7)): glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .BR ualarm (): .ad l .RS 4 .PD 0 .TP 4 .\"O Since glibc 2.12: glibc 2.12 以降: .nf _BSD_SOURCE || (_XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) && !(_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700) .TP 4 .fi .\"O Before glibc 2.12: glibc 2.12 より前: _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .PD .RE .ad b .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR ualarm () .\"O function causes the signal .\"O .B SIGALRM .\"O to be sent to the invoking process after (not less than) .\"O .I usecs .\"O microseconds. .BR ualarm () 関数は、呼び出し元のプロセスに対して .I usecs マイクロ秒 (以上) 後に .B SIGALRM シグナルを送る。 .\"O The delay may be lengthened slightly by any system activity .\"O or by the time spent processing the call or by the .\"O granularity of system timers. 遅れはシステムの活性度・呼び出しの処理時間・ システムタイマーの粒度によって長くなるかもしれない。 .LP .\"O Unless caught or ignored, the .\"O .B SIGALRM .\"O signal will terminate the process. 捕捉または無視されない限り、 .B SIGALRM シグナルはプロセスを終了させる。 .LP .\"O If the .\"O .I interval .\"O argument is nonzero, further .\"O .B SIGALRM .\"O signals will be sent every .\"O .I interval .\"O microseconds after the first. .I interval 引き数が 0 でない場合、最初の .B SIGALRM シグナルの後、 さらに .I interval マイクロ秒毎に SIGALRM シグナルが送られる。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O This function returns the number of microseconds remaining for .\"O any alarm that was previously set, or 0 if no alarm was pending. この関数は、過去に設定された alarm の残りマイクロ秒数を返す。 実行中の alarm がない場合は 0 を返す。 .\"O .SH ERRORS .SH エラー .TP .B EINTR .\"O Interrupted by a signal. シグナルによって割り込まれた。 .TP .B EINVAL .\"O \fIusecs\fP or \fIinterval\fP is not smaller than 1000000. .\"O (On systems where that is considered an error.) \fIusecs\fP または \fIinterval\fP が 1000000 未満でない (これがエラーとして扱われるシステムの場合)。 .\"O .SH "CONFORMING TO" .SH 準拠 4.3BSD, POSIX.1-2001. .\"O POSIX.1-2001 marks .\"O .BR ualarm () .\"O as obsolete. POSIX.1-2001 では .BR ualarm () は過去のものとされている。 .\"O POSIX.1-2008 removes the specification of .\"O .BR ualarm (). POSIX.1-2008 では、 .BR ualarm () の仕様が削除されている。 .\"O 4.3BSD, SUSv2, and POSIX do not define any errors. 4.3BSD, SUSv2, POSIX はエラーを定義していない。 .\"O .SH NOTES .SH 注意 .\"O The type .\"O .I useconds_t .\"O is an unsigned integer type capable of holding integers .\"O in the range [0,1000000]. .I useconds_t 型は [0,1000000] の範囲の整数を保持できる符号なし整数型である。 .\"O On the original BSD implementation, and in glibc before version 2.1, .\"O the arguments to .\"O .BR ualarm () .\"O were instead typed as .\"O .IR "unsigned int" . もともとの BSD での実装や、バージョン 2.1 より前の glibc では、 .BR ualarm () の引き数の型は .I "unsigned int" であった。 .\"O Programs will be more portable if they never mention .\"O .I useconds_t .\"O explicitly. プログラム中に明示的に .I useconds_t と書かない方が、移植性が高くなる。 .\"Osato: .\"Osato: mention が訳しづらい。 .\"Osato: .LP .\"O The interaction of this function with .\"O other timer functions such as この関数と .BR alarm (2), .BR sleep (3), .BR nanosleep (2), .BR setitimer (2), .BR timer_create (2), .BR timer_delete (2), .BR timer_getoverrun (2), .BR timer_gettime (2), .BR timer_settime (2), .BR usleep (3) .\"O is unspecified. のような他のタイマー関数との相互作用は規定されていない。 .LP .\"O This function is obsolete. .\"O Use .\"O .BR setitimer (2) .\"O or POSIX interval timers .\"O .RB ( timer_create (2), .\"O etc.) .\"O instead. この関数は廃止予定である。 代わりに .BR setitimer (2) もしくは POSIX インターバルタイマ .RB ( timer_create (2) など) を使うこと。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR alarm (2), .BR getitimer (2), .BR nanosleep (2), .BR select (2), .BR setitimer (2), .BR usleep (3), .BR time (7)