This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Suspend a thread until a timeout or signal occurs
#include <time.h> int nanosleep( const struct timespec* rqtp, struct timespec* rmtp );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The nanosleep() function causes the calling thread to be suspended from execution until either:
Or
The suspension time may be longer than requested because the argument value is rounded up to be a multiple of the system timer resolution or because of scheduling and other system activity.
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
errno, clock_getres(), clock_gettime(), clock_settime(), sleep(), timer_create(), timer_delete(), timer_gettime(), timer_settime(), timespec