date and time created 93/05/24 10:58:50 by bostic
[unix-history] / usr / src / lib / libc / gen / ualarm.3
CommitLineData
ae59e04c
CL
1.\" Copyright (c) 1986, 1991 Regents of the University of California.
2.\" All rights reserved.
cb026509 3.\"
ae59e04c 4.\" %sccs.include.redist.man%
cb026509 5.\"
ae59e04c
CL
6.\" @(#)ualarm.3 6.5 (Berkeley) %G%
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
cb026509 20This is a simplified interface to setitimer(2).
ae59e04c
CL
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
cb026509 33If the
ae59e04c
CL
34.Fa interval
35argument is non-zero, the
36.Dv SIGALRM
37signal will be sent
cb026509 38to the process every
ae59e04c 39.Fa interval
cb026509 40microseconds after the timer expires (e.g. after
ae59e04c 41.Fa value
cb026509 42microseconds have passed).
ae59e04c
CL
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 mumber 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 .