Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man3c / sleep.3c
blob4fada59ca5971cd2c17868124b31d75bec7469c0
1 '\" te
2 .\" Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" Portions Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
6 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
8 .\"  This notice shall appear on any product containing this material.
9 .\" 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.
10 .\" 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.
11 .\" 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]
12 .TH SLEEP 3C "Feb 5, 2008"
13 .SH NAME
14 sleep \- suspend execution for an interval of time
15 .SH SYNOPSIS
16 .LP
17 .nf
18 #include <unistd.h>
20 \fBunsigned int\fR \fBsleep\fR(\fBunsigned int\fR \fIseconds\fR);
21 .fi
23 .SH DESCRIPTION
24 .sp
25 .LP
26 The caller is suspended from execution for the number of \fIseconds\fR
27 specified by the argument. The actual suspension time may be less than that
28 requested because any caught signal will terminate the \fBsleep()\fR following
29 execution of that signal's catching routine. The suspension time may be longer
30 than requested by an arbitrary amount because of the scheduling of other
31 activity in the system. The value returned by \fBsleep()\fR will be the
32 ``unslept'' amount (the requested time minus the time actually slept) if the
33 caller incurred premature arousal because of a caught signal.
34 .sp
35 .LP
36 The use of the \fBsleep()\fR function has no effect on the action or blockage
37 of any signal. In a multithreaded process, only the invoking thread is
38 suspended from execution.
39 .SH ATTRIBUTES
40 .sp
41 .LP
42 See \fBattributes\fR(5) for descriptions of the following attributes:
43 .sp
45 .sp
46 .TS
47 box;
48 c | c
49 l | l .
50 ATTRIBUTE TYPE  ATTRIBUTE VALUE
52 Interface Stability     Committed
54 MT-Level        Async-Signal-Safe
56 Standard        See \fBstandards\fR(5).
57 .TE
59 .SH SEE ALSO
60 .sp
61 .LP
62 \fBnanosleep\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)