xref: /original-bsd/lib/libc/gen/alarm.3 (revision e58c8952)
1.\" Copyright (c) 1980, 1991, 1993, 1994
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)alarm.3	8.2 (Berkeley) 04/19/94
7.\"
8.Dd
9.Dt ALARM 3
10.Os BSD 4
11.Sh NAME
12.Nm alarm
13.Nd set signal timer alarm
14.Sh SYNOPSIS
15.Fd #include <unistd.h>
16.Ft u_int
17.Fn alarm "u_int seconds"
18.Sh DESCRIPTION
19.Bf -symbolic
20This interface is made obsolete by setitimer(2).
21.Ef
22.Pp
23The
24.Fn alarm
25function
26waits a count of
27.Ar seconds
28before asserting the terminating signal
29.Dv SIGALRM .
30When the signal has successfully been caught,
31.Fn alarm
32returns the amount of time left on the clock.
33The maximum number of
34.Ar seconds
35allowed
36is 2147483647.
37.Pp
38If an alarm has been set with
39.Fn alarm ,
40another call to
41.Fn alarm
42will supersede the prior call.
43The request
44.Fn alarm "0"
45voids the current
46alarm.
47.Sh SEE ALSO
48.Xr sigaction 2 ,
49.Xr setitimer 2 ,
50.Xr sigpause 2 ,
51.Xr sigvec 2 ,
52.Xr signal 3 ,
53.Xr sleep 3 ,
54.Xr ualarm 3 ,
55.Xr usleep 3
56.Sh HISTORY
57An
58.Fn alarm
59function appeared in
60.At v7 .
61