1502 Remove conversion cruft from manpages
[unleashed.git] / usr / src / man / man2 / alarm.2
blobc43fa7d9666c8c2f4633eb383d810d3dd51b738f
1 '\" te
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"
8 .SH NAME
9 alarm \- schedule an alarm signal
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <unistd.h>
15 \fBunsigned int\fR \fBalarm\fR(\fBunsigned int\fR \fIseconds\fR);
16 .fi
18 .SH DESCRIPTION
19 .sp
20 .LP
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.
25 .sp
26 .LP
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.
30 .sp
31 .LP
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.
36 .sp
37 .LP
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.
41 .SH RETURN VALUES
42 .sp
43 .LP
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.
48 .SH ERRORS
49 .sp
50 .LP
51 The \fBalarm()\fR function is always successful; no return value is reserved to
52 indicate an error.
53 .SH ATTRIBUTES
54 .sp
55 .LP
56 See \fBattributes\fR(5) for descriptions of the following attributes:
57 .sp
59 .sp
60 .TS
61 box;
62 c | c
63 l | l .
64 ATTRIBUTE TYPE  ATTRIBUTE VALUE
66 Interface Stability     Standard
68 MT-Level        Async-Signal-Safe
69 .TE
71 .SH SEE ALSO
72 .sp
73 .LP
74 \fBexec\fR(2), \fBfork\fR(2), \fBsignal.h\fR(3HEAD), \fBattributes\fR(5),
75 \fBstandards\fR(5)