]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/sleep.3
membarrier.2: Remove redundant mention of return value of MEMBARRIER_CMD_SHARED
[thirdparty/man-pages.git] / man3 / sleep.3
CommitLineData
bf5a7247 1.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
fea681da 2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
7.\"
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
c13182ef 12.\"
fea681da
MK
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date. The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
16.\" the use of the information contained herein. The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
c13182ef 20.\"
fea681da
MK
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 23.\" %%%LICENSE_END
c08df37a 24.\"
fea681da 25.\" Modified Sat Jul 24 18:16:02 1993 by Rik Faith (faith@cs.unc.edu)
460495ca 26.TH SLEEP 3 2015-08-08 "GNU" "Linux Programmer's Manual"
fea681da 27.SH NAME
f68512e9 28sleep \- sleep for the specified number of seconds
fea681da
MK
29.SH SYNOPSIS
30.nf
31.B #include <unistd.h>
32.sp
33.BI "unsigned int sleep(unsigned int " "seconds" );
34.fi
35.SH DESCRIPTION
63aa9df0 36.BR sleep ()
1bfdc3cb 37makes the calling thread sleep until
fea681da
MK
38.I seconds
39seconds have elapsed or a signal arrives which is not ignored.
47297adb 40.SH RETURN VALUE
cfd4a9a6
MK
41Zero if the requested time has elapsed,
42or the number of seconds left to sleep,
43if the call was interrupted by a signal handler.
7e548ead
ZL
44.SH ATTRIBUTES
45For an explanation of the terms used in this section, see
46.BR attributes (7).
47.TS
48allbox;
49lb lb lbw27
50l l l.
51Interface Attribute Value
52T{
53.BR sleep ()
54T} Thread safety MT-Unsafe sig:SIGCHLD/linux
55.TE
56
47297adb 57.SH CONFORMING TO
a6db971b 58POSIX.1-2001, POSIX.1-2008.
fea681da 59.SH BUGS
63aa9df0 60.BR sleep ()
fea681da
MK
61may be implemented using
62.BR SIGALRM ;
63mixing calls to
bfbfd71d 64.BR alarm (2)
fea681da 65and
63aa9df0 66.BR sleep ()
fea681da
MK
67is a bad idea.
68.PP
69Using
fb186734 70.BR longjmp (3)
c13182ef 71from a signal handler or modifying the handling of
fea681da
MK
72.B SIGALRM
73while sleeping will cause undefined results.
47297adb 74.SH SEE ALSO
fea681da 75.BR alarm (2),
87209bbe 76.BR nanosleep (2),
cfd4a9a6
MK
77.BR signal (2),
78.BR signal (7)