xref: /original-bsd/lib/libc/gen/ualarm.3 (revision e58c8952)
1.\" Copyright (c) 1986, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)ualarm.3	8.2 (Berkeley) 04/19/94
7.\"
8.Dd
9.Dt UALARM 3
10.Os BSD 4.3
11.Sh NAME
12.Nm ualarm
13.Nd schedule signal after specified time
14.Sh SYNOPSIS
15.Fd #include <unistd.h>
16.Ft u_int
17.Fn ualarm "u_int microseconds" "u_int interval"
18.Sh DESCRIPTION
19.Bf -symbolic
20This is a simplified interface to setitimer(2).
21.Ef
22.Pp
23The
24.Fn ualarm
25function
26waits a count of
27.Ar microseconds
28before asserting the terminating signal
29.Dv SIGALRM .
30System activity or time used in processing the call may cause a slight
31delay.
32.Pp
33If the
34.Fa interval
35argument is non-zero, the
36.Dv SIGALRM
37signal will be sent
38to the process every
39.Fa interval
40microseconds after the timer expires (e.g. after
41.Fa value
42microseconds have passed).
43.Sh RETURN VALUES
44When the signal has successfully been caught,
45.Fn alarm
46returns the amount of time left on the clock.
47The maximum number of
48.Ar microseconds
49allowed
50is 2147483647.
51.Sh SEE ALSO
52.Xr getitimer 2 ,
53.Xr setitimer 2 ,
54.Xr sigpause 2 ,
55.Xr sigvec 2 ,
56.Xr signal 3 ,
57.Xr sleep 3 ,
58.Xr alarm 3 ,
59.Xr usleep 3
60.Sh HISTORY
61The
62.Fn ualarm
63function appeared in
64.Bx 4.3 .
65