![]() |
![]() |
![]() |
suspend process until a timeout or signal
#include <sys/time.h> int nanosleep( struct timespec *rqtp, struct timespec *rmtp );
The nanosleep() function causes the calling process to be suspended from execution until either
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.
If the nanosleep() function returns because the requested time has elapsed, its return value is zero. If it was interrupted by a signal, -1 is returned and errno is set.
If the rmtp argument is non-NULL, the timespec structure referenced by it is updated to contain the amount of time remaining in the interval (the requested time minus the time actually slept).
POSIX 1003.4
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
errno, clock_getres(), clock_gettime(), clock_setres(), clock_settime(), sleep(), timer_create(), timer_delete(), timer_gettime(), timer_settime(), ticksize utility
![]() |
![]() |
![]() |