.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" This manpage is Copyright (C) 1992 Drew Eckhardt; .\" 1993 Michael Haardt, Ian Jackson. .\" .\" 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. .\" .\" 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 .\" .\" Дата последней коррекции перевода 11.12.2003 .\" Перевод с английского сделал Виктор Вислобоков .\" http://www.linuxshare.ru/projects/trans/mans.html .\" .TH ALARM 2 1993-07-21 Linux "Руководство программиста Linux" .SH ИМЯ alarm \- установка времени доставки тревожного сигнала .SH ОБЗОР .nf .B #include .sp .BI "unsigned int alarm(unsigned int " seconds ); .fi .SH ОПИСАНИЕ Системный вызов .BR alarm " выполняет в вызвавший его процесс доставку сигнала " SIGALRM через .I seconds секунд. Если .I seconds равно нулю, то никаких новых тревожных сигналов в очередь поставлено не будет. Если случиться какое-либо событие (интересно какое? -- прим. пер.), любые предыдущие установки .B alarm отменяются. .SH "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ" .B alarm возвращает количество секунд, оставшихся до момента доставки сигнала, установленного предыдущим вызовом .B alarm или ноль, если в очереди нет тревожных сигналов. .SH ЗАМЕЧАНИЯ Вызовы .BR alarm " и " setitimer совместно используют один и тот же таймер; они будут конфликтовать друг с другом. .PP .B sleep() может быть реализован, используя .BR SIGALRM ; так что смешанное использование вызовов .B alarm() и .B sleep() \- это плохая идея. Постановка сигнала в очередь может вызывать задержу выполнения вызвавшего процесса на некоторое время. .SH "СООТВЕТСТВИЕ СТАНДАРТАМ" SVr4, SVID, POSIX, X/OPEN, BSD 4.3 .SH "СМОТРИ ТАКЖЕ" .BR setitimer (2), .BR signal (2), .BR sigaction (2), .BR gettimeofday (2), .BR select (2), .BR pause (2), .BR sleep (3) .SH ПЕРЕВОД Перевёл с английского Виктор Вислобоков 2003