NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES
$(OS_DIR)/lib/libc.a #include <time.h>int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
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 nanosleep() function causes the current thread to be suspended from execution for a period specified in the rqtp argument. The suspension time may be longer than requested because the argument value is rounded up to an integer multiple of the resolution of the system realtime clock (CLOCK_REALTIME) or due to scheduling of other activities in the system.
If the current thread is aborted while suspended, nanosleep () returns immediately with errno set to EINTR. In this case, if the rmtp argument is not NULL, the time remaining before nanosleep() would have terminated is normally stored at the location referenced by rmtp
On normal completion after the requested time has elapsed, nanosleep() returns zero. Otherwise, if nanosleep() returned prematurely due to an abort, or if any other error is detected, a value of -1 is returned and errno is set to indicate the error condition.
A pointer argument contains an address outside the current actor's address space.
nanosleep() was interrupted by an abort.
The rqtp argument is NULL, or the time specification referenced by rqtp contains an invalid value.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES