1ALARM(2) Linux Programmer's Manual ALARM(2)
2
3
4
6 alarm - set an alarm clock for delivery of a signal
7
9 #include <unistd.h>
10
11 unsigned int alarm(unsigned int seconds);
12
14 alarm() arranges for a SIGALRM signal to be delivered to the process in
15 seconds seconds.
16
17 If seconds is zero, no new alarm() is scheduled.
18
19 In any event any previously set alarm() is cancelled.
20
22 alarm() returns the number of seconds remaining until any previously
23 scheduled alarm was due to be delivered, or zero if there was no previ‐
24 ously scheduled alarm.
25
27 alarm() and setitimer() share the same timer; calls to one will inter‐
28 fere with use of the other.
29
30 sleep() may be implemented using SIGALRM; mixing calls to alarm() and
31 sleep() is a bad idea.
32
33 Scheduling delays can, as ever, cause the execution of the process to
34 be delayed by an arbitrary amount of time.
35
37 SVr4, POSIX.1-2001, 4.3BSD
38
40 gettimeofday(2), pause(2), select(2), setitimer(2), sigaction(2), sig‐
41 nal(2), sleep(3), time(7)
42
43
44
45Linux 1993-07-21 ALARM(2)