If the nanosleep() function returns because the requested time has elapsed, its return value is 0.
If the nanosleep() function returns because it has been interrupted by a signal, the function returns a value of -1 and sets errno to indicate the interruption.
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). If the rmtp argument is NULL, the remaining time is not returned.
If nanosleep() fails, it returns -1 and sets errno to indicate the error.
|