Print this page
11622 clean up rarer mandoc lint warnings
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3c/nanosleep.3c.man.txt
+++ new/usr/src/man/man3c/nanosleep.3c.man.txt
1 1 NANOSLEEP(3C) Standard C Library Functions NANOSLEEP(3C)
2 2
3 3
4 4
5 5 NAME
6 6 nanosleep, thrd_sleep - high resolution sleep
7 7
8 8 SYNOPSIS
9 9 #include <time.h>
10 10
11 11 int nanosleep(const struct timespec *rqtp,
12 12 struct timespec *rmtp);
13 13
14 14 #include <threads.h>
15 15
16 16 int thrd_sleep(const struct timespec *rqtp,
17 17 struct timespec *rmtp);
18 18
19 19
20 20 DESCRIPTION
21 21 The nanosleep() and thrd_sleep() functions cause the current thread to
22 22 be suspended from execution until either the time interval specified by
23 23 the rqtp argument has elapsed or a signal is delivered to the calling
24 24 thread and its action is to invoke a signal-catching function or to
25 25 terminate the process. The suspension time may be longer than requested
26 26 because the argument value is rounded up to an integer multiple of the
27 27 sleep resolution or because of the scheduling of other activity by the
28 28 system. But, except for the case of being interrupted by a signal, the
29 29 suspension time will not be less than the time specified by rqtp, as
30 30 measured by the system clock, CLOCK_REALTIME.
31 31
32 32
33 33 The use of the nanosleep() and thrd_sleep() functions has no effect on
34 34 the action or blockage of any signal.
35 35
36 36 RETURN VALUES
37 37 If the nanosleep() or thrd_sleep() function returns because the
38 38 requested time has elapsed, its return value is 0.
39 39
40 40
41 41 If the nanosleep() function returns because it has been interrupted by
42 42 a signal, the function returns a value of -1 and sets errno to indicate
43 43 the interruption. If the rmtp argument is non-NULL, the timespec
44 44 structure referenced by it is updated to contain the amount of time
45 45 remaining in the interval (the requested time minus the time actually
46 46 slept). If the rmtp argument is NULL, the remaining time is not
47 47 returned.
48 48
49 49
50 50 If nanosleep() fails, it returns -1 and sets errno to indicate the
51 51 error.
52 52
53 53
54 54 The thrd_sleep() function may fail for identical reasons as the
55 55 nanosleep() function and returns -1; however, the C11 standard does not
56 56 define that errno should be set, therefore callers of thrd_sleep()
57 57 cannot rely on errno being set or staying the same across a call to
58 58 thrd_sleep() .
59 59
60 60
61 61 ERRORS
62 62 The nanosleep() function will fail if:
63 63
64 64 EINTR
65 65 The nanosleep() function was interrupted by a signal.
66 66
67 67
68 68 EINVAL
69 69 The rqtp argument specified a nanosecond value less than zero
70 70 or greater than or equal to 1000 million.
71 71
72 72
73 73 ENOSYS
74 74 The nanosleep() function is not supported by this
75 75 implementation.
76 76
77 77
78 78 ATTRIBUTES
79 79 See attributes(5) for descriptions of the following attributes:
80 80
81 81
82 82
83 83
84 84 +--------------------+-------------------+
85 85 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
86 86 +--------------------+-------------------+
87 87 |Interface Stability | Committed |
88 88 +--------------------+-------------------+
89 89 |MT-Level | MT-Safe |
90 90 +--------------------+-------------------+
91 91 |Standard | See standards(5). |
92 92 +--------------------+-------------------+
93 93
94 94 SEE ALSO
95 95 sleep(3C), time.h(3HEAD), attributes(5), standards(5)
96 96
97 97
98 98
99 99 March 27, 2016 NANOSLEEP(3C)
↓ open down ↓ |
99 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX