1usleep(3C) Standard C Library Functions usleep(3C)
2
3
4
6 usleep - suspend execution for interval in microseconds
7
9 #include <unistd.h>
10
11 int usleep(useconds_t useconds);
12
13
15 The usleep() function suspends the caller from execution for the number
16 of microseconds specified by the useconds argument. The actual suspen‐
17 sion time might be less than requested because any caught signal will
18 terminate usleep() following execution of that signal's catching rou‐
19 tine. The suspension time might be longer than requested by an arbi‐
20 trary amount because of the scheduling of other activity in the system.
21
22
23 If the value of useconds is 0, then the call has no effect.
24
25
26 The use of the usleep() function has no effect on the action or block‐
27 age of any signal. In a multithreaded process, only the invoking thread
28 is suspended from execution.
29
31 On completion, usleep() returns 0. There are no error returns.
32
34 No errors are returned.
35
37 The usleep() function is included for its historical usage. The
38 nanosleep(3C) function is preferred over this function.
39
41 See attributes(5) for descriptions of the following attributes:
42
43
44
45
46 ┌─────────────────────────────┬─────────────────────────────┐
47 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
48 ├─────────────────────────────┼─────────────────────────────┤
49 │Interface Stability │Committed │
50 ├─────────────────────────────┼─────────────────────────────┤
51 │MT-Level │Safe │
52 ├─────────────────────────────┼─────────────────────────────┤
53 │Standard │See standards(5). │
54 └─────────────────────────────┴─────────────────────────────┘
55
57 nanosleep(3C), sleep(3C), attributes(5), standards(5)
58
59
60
61SunOS 5.11 5 Feb 2008 usleep(3C)