blob: 00167a28b224e506389e648c4bec22e6505d0b85 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
SLEEP(3) Linux Programmer's Manual SLEEP(3)
NNAAMMEE
sleep - sleep for a specified number of seconds
SSYYNNOOPPSSIISS
##iinncclluuddee <<uunniissttdd..hh>>
uunnssiiggnneedd iinntt sslleeeepp((uunnssiiggnneedd iinntt _s_e_c_o_n_d_s));;
DDEESSCCRRIIPPTTIIOONN
sslleeeepp() causes the calling thread to sleep either until the number of
real-time seconds specified in _s_e_c_o_n_d_s have elapsed or until a signal ar‐
rives which is not ignored.
RREETTUURRNN VVAALLUUEE
Zero if the requested time has elapsed, or the number of seconds left to
sleep, if the call was interrupted by a signal handler.
AATTTTRRIIBBUUTTEESS
For an explanation of the terms used in this section, see aattttrriibbuutteess(7).
┌──────────┬───────────────┬─────────────────────────────┐
│IInntteerrffaaccee │ AAttttrriibbuuttee │ VVaalluuee │
├──────────┼───────────────┼─────────────────────────────┤
│sslleeeepp() │ Thread safety │ MT-Unsafe sig:SIGCHLD/linux │
└──────────┴───────────────┴─────────────────────────────┘
CCOONNFFOORRMMIINNGG TTOO
POSIX.1-2001, POSIX.1-2008.
NNOOTTEESS
On Linux, sslleeeepp() is implemented via nnaannoosslleeeepp(2). See the nnaannoosslleeeepp(2)
man page for a discussion of the clock used.
PPoorrttaabbiilliittyy nnootteess
On some systems, sslleeeepp() may be implemented using aallaarrmm(2) and SSIIGGAALLRRMM
(POSIX.1 permits this); mixing calls to aallaarrmm(2) and sslleeeepp() is a bad
idea.
Using lloonnggjjmmpp(3) from a signal handler or modifying the handling of
SSIIGGAALLRRMM while sleeping will cause undefined results.
SSEEEE AALLSSOO
sslleeeepp(1), aallaarrmm(2), nnaannoosslleeeepp(2), ssiiggnnaall(2), ssiiggnnaall(7)
CCOOLLOOPPHHOONN
This page is part of release 5.10 of the Linux _m_a_n_-_p_a_g_e_s project. A de‐
scription of the project, information about reporting bugs, and the lat‐
est version of this page, can be found at
https://www.kernel.org/doc/man-pages/.
GNU 2017-09-15 SLEEP(3)
|