'\"macro stdmacro
.if n .pH g2.alarm @(#)alarm	40.10 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} alarm 2 "" "\&"
.if \nX=1 .ds x} alarm 2 ""
.if \nX=2 .ds x} alarm 2 "" "\&"
.if \nX=3 .ds x} alarm "" "" "\&"
.TH \*(x}
.SH NAME
\f4alarm\f1 \- set a process alarm clock
.SH SYNOPSIS
\f4#include <unistd.h>\f1
.PP
\f4unsigned alarm(unsigned sec);\f1
.SH DESCRIPTION
\f4alarm\fP
instructs the alarm clock of the calling process to send the signal
\f4SIGALRM\fP
to the calling process after the number of real time seconds specified by
.I sec\^
have elapsed
[see 
\f4signal\fP(2)].
.PP
Alarm requests are not stacked;
successive calls reset the alarm clock of the calling process.
.PP
If
.I sec\^
is 0, any previously made alarm request is canceled.
.P
\f4fork\fP sets the alarm clock of a new process to 0 [see \f4fork\fP(2)].
A process created by the exec family of routines inherits the time left on
the old process's alarm clock.
.SH "SEE ALSO"
\f4fork\fP(2), \f4exec\fP(2), \f4pause\fP(2), \f4signal\fP(2), \f4sigset\fP(2).
.SH DIAGNOSTICS
\f4alarm\fP
returns the amount of time
previously remaining in the alarm clock of the calling process.
.\"	@(#)alarm.2	6.2 of 9/6/83
.Ee
