NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ATTRIBUTES
$(OS_DIR)/lib/libc.a #include <unistd.h>u_int sleep(u_int seconds);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
The sleep() function suspends execution of the calling process for seconds of time. System activity or time spent in processing the call may lengthen the sleep by a second.
If a timer is already running on the process, its state is saved. If the value seconds is more than or equal to the remaining clock time for the saved timer, the sleep time is set to the remaining clock time. The state of the previous timer is restored after seconds have passed.
The sleep() function returns the number of seconds remaining to complete the operation. If sleep() is interrupted or cannot allocate a timer it returns the value needed to be passed to a subsequent sleep() function to complete the necessary delay. sleep() may be used repeatedly until it returns zero, in which case it will "busy-wait" until a timer is available.
See attributes(5) for descriptions of the following attributes:
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|---|---|
| Interface Stability | Evolving |
| MT-Level | Async-Signal-Safe |
NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ATTRIBUTES