1ALARM(2)                   Linux Programmer's Manual                  ALARM(2)
2
3
4

NAME

6       alarm - set an alarm clock for delivery of a signal
7

SYNOPSIS

9       #include <unistd.h>
10
11       unsigned int alarm(unsigned int seconds);
12

DESCRIPTION

14       alarm()  arranges  for  a SIGALRM signal to be delivered to the calling
15       process in seconds seconds.
16
17       If seconds is zero, any pending alarm is canceled.
18
19       In any event any previously set alarm() is canceled.
20

RETURN VALUE

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

CONFORMING TO

27       POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.
28

NOTES

30       alarm() and setitimer(2) share the same timer; calls to one will inter‐
31       fere with use of the other.
32
33       Alarms  created  by  alarm() are preserved across execve(2) and are not
34       inherited by children created via fork(2).
35
36       sleep(3) may be implemented using SIGALRM; mixing calls to alarm()  and
37       sleep(3) is a bad idea.
38
39       Scheduling  delays  can, as ever, cause the execution of the process to
40       be delayed by an arbitrary amount of time.
41

SEE ALSO

43       gettimeofday(2), pause(2), select(2), setitimer(2), sigaction(2),  sig‐
44       nal(2), timer_create(2), timerfd_create(2), sleep(3), time(7)
45

COLOPHON

47       This  page  is  part of release 5.07 of the Linux man-pages project.  A
48       description of the project, information about reporting bugs,  and  the
49       latest     version     of     this    page,    can    be    found    at
50       https://www.kernel.org/doc/man-pages/.
51
52
53
54Linux                             2017-05-03                          ALARM(2)
Impressum