The nanosleep function suspends a process or thread until one of the following conditions is met: o The time interval specified by the rqtp argument has elapsed. o A signal is delivered to the calling process and the action is to invoke a signal-catching function or to terminate the process. The suspension time may be longer than requested because the argument value is rounded up to an integer multiple of the sleep resolution or because of the scheduling of other activity by the system. Except when interrupted by a signal, the suspension time is not less than the time specified by the rqtp argument (as measured by the system clock, CLOCK_REALTIME). The use of the nanosleep function has no effect on the action or blockage of any signal. If the requested time has elapsed, the call was successful and the nanosleep function returns zero. On failure, the nanosleep function returns -1 and sets errno to indicate the failure. The function fails if it has been interrupted by a signal, or if the rqtp argument specified a nanosecond value less than 0 or greater than or equal to 1 billion. If the rmtp argument is non-NULL, the timespec structure it references 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. See also clock_getres, clock_gettime, clock_settime, and sleep.