1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\" Modified Sat Jul 24 18:16:02 1993 by Rik Faith (faith@cs.unc.edu)
6 .TH SLEEP 3 2021-03-22 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
8 sleep \- sleep for a specified number of seconds
11 .RI ( libc ", " \-lc )
14 .B #include <unistd.h>
16 .BI "unsigned int sleep(unsigned int " "seconds" );
20 causes the calling thread to sleep either until
21 the number of real-time seconds specified in
23 have elapsed or until a signal arrives which is not ignored.
25 Zero if the requested time has elapsed,
26 or the number of seconds left to sleep,
27 if the call was interrupted by a signal handler.
29 For an explanation of the terms used in this section, see
37 Interface Attribute Value
40 T} Thread safety MT-Unsafe sig:SIGCHLD/linux
46 POSIX.1-2001, POSIX.1-2008.
54 man page for a discussion of the clock used.
58 may be implemented using
62 (POSIX.1 permits this);
71 from a signal handler or modifying the handling of
73 while sleeping will cause undefined results.