]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Hey Emacs! This file is -*- nroff -*- source. |
2 | .\" | |
3 | .\" This manpage is Copyright (C) 1992 Drew Eckhardt; | |
4 | .\" 1993 Michael Haardt, Ian Jackson. | |
5 | .\" | |
6 | .\" Permission is granted to make and distribute verbatim copies of this | |
7 | .\" manual provided the copyright notice and this permission notice are | |
8 | .\" preserved on all copies. | |
9 | .\" | |
10 | .\" Permission is granted to copy and distribute modified versions of this | |
11 | .\" manual under the conditions for verbatim copying, provided that the | |
12 | .\" entire resulting derived work is distributed under the terms of a | |
13 | .\" permission notice identical to this one. | |
14 | .\" | |
15 | .\" Since the Linux kernel and libraries are constantly changing, this | |
16 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
17 | .\" responsibility for errors or omissions, or for damages resulting from | |
18 | .\" the use of the information contained herein. The author(s) may not | |
19 | .\" have taken the same level of care in the production of this manual, | |
20 | .\" which is licensed free of charge, as they might when working | |
21 | .\" professionally. | |
22 | .\" | |
23 | .\" Formatted or processed versions of this manual, if unaccompanied by | |
24 | .\" the source, must acknowledge the copyright and authors of this work. | |
25 | .\" | |
26 | .\" Modified Wed Jul 21 19:42:57 1993 by Rik Faith <faith@cs.unc.edu> | |
27 | .\" Modified Sun Jul 21 21:25:26 1996 by Andries Brouwer <aeb@cwi.nl> | |
28 | .\" Modified Wed Nov 6 03:46:05 1996 by Eric S. Raymond <esr@thyrsus.com> | |
29 | .\" | |
30 | .TH ALARM 2 1993-07-21 Linux "Linux Programmer's Manual" | |
31 | .SH NAME | |
32 | alarm \- set an alarm clock for delivery of a signal | |
33 | .SH SYNOPSIS | |
34 | .nf | |
35 | .B #include <unistd.h> | |
36 | .sp | |
37 | .BI "unsigned int alarm(unsigned int " seconds ); | |
38 | .fi | |
39 | .SH DESCRIPTION | |
40 | .BR alarm " arranges for a " SIGALRM | |
41 | signal to be delivered to the process in | |
42 | .I seconds | |
43 | seconds. | |
44 | ||
45 | If | |
46 | .I seconds | |
47 | is zero, no new | |
48 | .B alarm | |
49 | is scheduled. | |
50 | ||
51 | In any event any previously set | |
52 | .B alarm | |
53 | is cancelled. | |
54 | .SH "RETURN VALUE" | |
55 | .B alarm | |
56 | returns the number of seconds remaining until any previously scheduled | |
57 | alarm was due to be delivered, or zero if there was no previously | |
58 | scheduled alarm. | |
59 | .SH NOTES | |
60 | .BR alarm " and " setitimer | |
61 | share the same timer; calls to one will interfere with use of the | |
62 | other. | |
63 | .PP | |
64 | .B sleep() | |
65 | may be implemented using | |
66 | .BR SIGALRM ; | |
67 | mixing calls to | |
68 | .B alarm() | |
69 | and | |
70 | .B sleep() | |
71 | is a bad idea. | |
72 | ||
73 | Scheduling delays can, as ever, cause the execution of the process to | |
74 | be delayed by an arbitrary amount of time. | |
75 | .SH "CONFORMING TO" | |
76 | SVr4, SVID, POSIX, X/OPEN, BSD 4.3 | |
77 | .SH "SEE ALSO" | |
78 | .BR gettimeofday (2), | |
79 | .BR pause (2), | |
80 | .BR select (2), | |
81 | .BR setitimer (2), | |
82 | .BR sigaction (2), | |
83 | .BR signal (2), | |
84 | .BR sleep (3) |