2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 1989 AT&T.
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH ALARM 2 "Jun 6, 2007"
9 alarm \- schedule an alarm signal
15 \fBunsigned int\fR \fBalarm\fR(\fBunsigned int\fR \fIseconds\fR);
21 The \fBalarm()\fR function causes the system to generate a \fBSIGALRM\fR signal
22 for the process after the number of real-time seconds specified by seconds
23 have elapsed (see \fBsignal.h\fR(3HEAD)). Processor scheduling delays may
24 prevent the process from handling the signal as soon as it is generated.
27 If \fIseconds\fR is 0, a pending alarm request, if any, is cancelled. If
28 \fIseconds\fR is greater than \fBLONG_MAX\fR/\fIhz\fR, \fIseconds\fR is rounded
29 down to \fBLONG_MAX\fR/\fIhz\fR. The value of \fIhz\fR is normally 100.
32 Alarm requests are not stacked; only one \fBSIGALRM\fR generation can be
33 scheduled in this manner; if the \fBSIGALRM\fR signal has not yet been
34 generated, the call will result in rescheduling the time at which the
35 \fBSIGALRM\fR signal will be generated.
38 The \fBfork\fR(2) function clears pending alarms in the child process. A new
39 process image created by one of the \fBexec\fR(2) functions inherits the time
40 left to an alarm signal in the old process's image.
44 If there is a previous alarm request with time remaining, \fBalarm()\fR
45 returns a non-zero value that is the number of seconds until the previous
46 request would have generated a \fBSIGALRM\fR signal. Otherwise,
47 \fBalarm()\fR returns 0.
51 The \fBalarm()\fR function is always successful; no return value is reserved to
56 See \fBattributes\fR(5) for descriptions of the following attributes:
64 ATTRIBUTE TYPE ATTRIBUTE VALUE
66 Interface Stability Standard
68 MT-Level Async-Signal-Safe
74 \fBexec\fR(2), \fBfork\fR(2), \fBsignal.h\fR(3HEAD), \fBattributes\fR(5),