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