1alarm(2) System Calls Manual alarm(2)
2
3
4
6 alarm - set an alarm clock for delivery of a signal
7
9 Standard C library (libc, -lc)
10
12 #include <unistd.h>
13
14 unsigned int alarm(unsigned int seconds);
15
17 alarm() arranges for a SIGALRM signal to be delivered to the calling
18 process in seconds seconds.
19
20 If seconds is zero, any pending alarm is canceled.
21
22 In any event any previously set alarm() is canceled.
23
25 alarm() returns the number of seconds remaining until any previously
26 scheduled alarm was due to be delivered, or zero if there was no previ‐
27 ously scheduled alarm.
28
30 POSIX.1-2008.
31
33 POSIX.1-2001, SVr4, 4.3BSD.
34
36 alarm() and setitimer(2) share the same timer; calls to one will inter‐
37 fere with use of the other.
38
39 Alarms created by alarm() are preserved across execve(2) and are not
40 inherited by children created via fork(2).
41
42 sleep(3) may be implemented using SIGALRM; mixing calls to alarm() and
43 sleep(3) is a bad idea.
44
45 Scheduling delays can, as ever, cause the execution of the process to
46 be delayed by an arbitrary amount of time.
47
49 gettimeofday(2), pause(2), select(2), setitimer(2), sigaction(2), sig‐
50 nal(2), timer_create(2), timerfd_create(2), sleep(3), time(7)
51
52
53
54Linux man-pages 6.05 2023-03-30 alarm(2)