.\" %%%LICENSE_END
.\"
.\" Modified Sat Jul 24 18:16:02 1993 by Rik Faith (faith@cs.unc.edu)
-.TH SLEEP 3 2010-02-03 "GNU" "Linux Programmer's Manual"
+.TH SLEEP 3 2017-09-15 "GNU" "Linux Programmer's Manual"
.SH NAME
-sleep \- sleep for the specified number of seconds
+sleep \- sleep for a specified number of seconds
.SH SYNOPSIS
.nf
.B #include <unistd.h>
-.sp
+.PP
.BI "unsigned int sleep(unsigned int " "seconds" );
.fi
.SH DESCRIPTION
.BR sleep ()
-makes the calling thread sleep until
+causes the calling thread to sleep either until
+the number of real-time seconds specified in
.I seconds
-seconds have elapsed or a signal arrives which is not ignored.
+have elapsed or until a signal arrives which is not ignored.
.SH RETURN VALUE
Zero if the requested time has elapsed,
or the number of seconds left to sleep,
if the call was interrupted by a signal handler.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lb lb lbw27
+l l l.
+Interface Attribute Value
+T{
+.BR sleep ()
+T} Thread safety MT-Unsafe sig:SIGCHLD/linux
+.TE
+.sp 1
.SH CONFORMING TO
-POSIX.1-2001.
-.SH BUGS
+POSIX.1-2001, POSIX.1-2008.
+.SH NOTES
+On Linux,
+.BR sleep ()
+is implemented via
+.BR nanosleep (2).
+See the
+.BR nanosleep (2)
+man page for a discussion of the clock used.
+.SS Portability notes
+On some systems,
.BR sleep ()
may be implemented using
-.BR SIGALRM ;
+.BR alarm (2)
+and
+.BR SIGALRM
+(POSIX.1 permits this);
mixing calls to
.BR alarm (2)
and
.B SIGALRM
while sleeping will cause undefined results.
.SH SEE ALSO
+.BR sleep (1),
.BR alarm (2),
.BR nanosleep (2),
.BR signal (2),