ualarmのヘルプ・マニュアル
日本語 英語
ualarm --help
man ualarm
UALARM(3) Linux Programmer’s Manual UALARM(3)
名前
ualarm - 指定したマイクロ秒後にシグナルを送る予定をする
書式
#include
useconds_t ualarm(useconds_t usecs, useconds_t interval);
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
ualarm(): _BSD_SOURCE || _XOPEN_SOURCE >= 500
説明
ualarm() 関数は、呼び出し元のプロセスに対して usecs マイクロ秒 (以上)
後に SIGALRM シグナルを送る。遅れはシステムの活性度・呼び出しの処理時間
・システムタイマーの粒度によって長くなるかもしれない。
捕捉または無視されない限り、 SIGALRM シグナルはプロセスを終了させる。
interval 引 き 数が 0 でない場合、最初の SIGALRM シグナルの後、さらに
interval マイクロ秒毎に SIGALRM シグナルが送られる。
返り値
この関数は、過去に設定された alarm の残りマイクロ秒数を返す。実行 中 の
alarm がない場合は 0 を返す。
エラー
EINTR シグナルによって割り込まれた。
EINVAL usecs または interval が 1000000 未満でない (これがエラーとして
扱われるシステムの場合)。
準拠
4.3BSD, POSIX.1-2001. POSIX.1-2001 では ualarm() は過去のものとされ て
い る 。 POSIX.1-2008 では、 ualarm() の仕様が削除されている。 4.3BSD,
SUSv2, POSIX はエラーを定義していない。
注意
useconds_t 型は [0,1000000] の範囲の整数を保持できる符号なし整数型で あ
る 。 も と もとの BSD での実装や、バージョン 2.1 より前の glibc では、
ualarm() の引き数の型は unsigned int であった。プログラム中に明示 的 に
useconds_t と書かない方が、移植性が高くなる。
こ の 関数と alarm(2), sleep(3), nanosleep(2), setitimer(2), timer_cre-
ate(2), timer_delete(2), timer_getoverrun(2), timer_gettime(2),
timer_settime(2), usleep(3) のような他のタイマー関数との相互作用は規定
されていない。
この関数は廃止予定である。代わりに setitimer(2) もしくは POSIX インター
バルタイマ (timer_create(2) など) を使うこと。
関連項目
alarm(2), getitimer(2), nanosleep(2), select(2), setitimer(2),
usleep(3), time(7)
2008-08-06 UALARM(3)
UALARM(3) Linux Programmer’s Manual UALARM(3)
NAME
ualarm - schedule signal after given number of microseconds
SYNOPSIS
#include
useconds_t ualarm(useconds_t usecs, useconds_t interval);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
ualarm(): _BSD_SOURCE || _XOPEN_SOURCE >= 500
DESCRIPTION
The ualarm() function causes the signal SIGALRM to be sent to the
invoking process after (not less than) usecs microseconds. The delay
may be lengthened slightly by any system activity or by the time spent
processing the call or by the granularity of system timers.
Unless caught or ignored, the SIGALRM signal will terminate the pro-
cess.
If the interval argument is non-zero, further SIGALRM signals will be
sent every interval microseconds after the first.
RETURN VALUE
This function returns the number of microseconds remaining for any
alarm that was previously set, or 0 if no alarm was pending.
ERRORS
EINTR Interrupted by a signal.
EINVAL usecs or interval is not smaller than 1000000. (On systems
where that is considered an error.)
CONFORMING TO
4.3BSD, POSIX.1-2001. POSIX.1-2001 marks ualarm() as obsolete.
POSIX.1-2008 removes the specification of ualarm(). 4.3BSD, SUSv2, and
POSIX do not define any errors.
NOTES
The type useconds_t is an unsigned integer type capable of holding
integers in the range [0,1000000]. On the original BSD implementation,
and in glibc before version 2.1, the arguments to ualarm() were instead
typed as unsigned int. Programs will be more portable if they never
mention useconds_t explicitly.
The interaction of this function with other timer functions such as
alarm(2), sleep(3), nanosleep(2), setitimer(2), timer_create(2),
timer_delete(2), timer_getoverrun(2), timer_gettime(2), timer_set-
time(2), usleep(3) is unspecified.
This function is obsolete. Use setitimer(2) or POSIX interval timers
(timer_create(2), etc.) instead.
SEE ALSO
alarm(2), getitimer(2), nanosleep(2), select(2), setitimer(2),
usleep(3), time(7)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
2008-08-06 UALARM(3)