.\" This manpage is Copyright (C) 1992 Drew Eckhardt; .\" and Copyright (C) 1993 Michael Haardt, Ian Jackson. .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" Modified Wed Jul 21 19:42:57 1993 by Rik Faith .\" Modified Sun Jul 21 21:25:26 1996 by Andries Brouwer .\" Modified Wed Nov 6 03:46:05 1996 by Eric S. Raymond .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya .\" all rights reserved. .\" Translated Wed Feb 22 20:02:18 JST 1997 .\" by HANATAKA Shinya .\" Updated 2013-07-22, Akihiro MOTOKI .\" .TH ALARM 2 " 2017\-05\-03" Linux "Linux Programmer's Manual" .SH 名前 alarm \- シグナル配送のためのアラームクロックを設定する .SH 書式 .nf \fB#include \fP .PP \fBunsigned int alarm(unsigned int \fP\fIseconds\fP\fB);\fP .fi .SH 説明 \fBalarm\fP() は \fBSIGALRM\fP シグナルを \fIseconds\fP 秒後に呼び出したプロセスに配送するように手配する。 .PP \fIseconds\fP がゼロならば、処理待ち (pending) のアラームはすべてキャンセルされる。 .PP 今までに設定されていた \fBalarm\fP() は中断される。 .SH 返り値 \fBalarm\fP() は以前に予定されていたアラームの配送までの残り時間を返す。以前に アラームが予定されていなければゼロを返す。 .SH 準拠 POSIX.1\-2001, POSIX.1\-2008, SVr4, 4.3BSD. .SH 注意 \fBalarm\fP() と \fBsetitimer\fP(2) は同じタイマーを共有している; 片方を呼び出すことはもう一方の 使用に影響を与える。 .PP \fBalarm\fP() で作成されたアラームは \fBexecve\fP(2) の前後で保持され、 \fBfork\fP(2) で作成された子プロセスには継承されない。 .PP \fBsleep\fP(3) は \fBSIGALRM\fP を利用して実装されているかもしれない。 \fBalarm\fP() と \fBsleep\fP(3) を混ぜて使用してはならない。 .PP スケジューリング(scheduling)の遅延により、プロセスの実行に不定量の 遅延が起きる可能性がある。 .SH 関連項目 \fBgettimeofday\fP(2), \fBpause\fP(2), \fBselect\fP(2), \fBsetitimer\fP(2), \fBsigaction\fP(2), \fBsignal\fP(2), \fBtimer_create\fP(2), \fBtimerfd_create\fP(2), \fBsleep\fP(3), \fBtime\fP(7) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。