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       SVr4, POSIX.1-2001, 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       sleep(3)  may be implemented using SIGALRM; mixing calls to alarm() and
34       sleep(3) is a bad idea.
35
36       Scheduling delays can, as ever, cause the execution of the  process  to
37       be delayed by an arbitrary amount of time.
38

SEE ALSO

40       gettimeofday(2),  pause(2), select(2), setitimer(2), sigaction(2), sig‐
41       nal(2), sleep(3), time(7)
42

COLOPHON

44       This page is part of release 3.53 of the Linux  man-pages  project.   A
45       description  of  the project, and information about reporting bugs, can
46       be found at http://www.kernel.org/doc/man-pages/.
47
48
49
50Linux                             2013-04-18                          ALARM(2)
Impressum