|NANOSLEEP(2)||System Calls Manual||NANOSLEEP(2)|
struct timespec *timeout,
nanosleep() suspends execution of the calling process for the duration specified by timeout. An unmasked signal will cause it to terminate the sleep early, regardless of the
SA_RESTARTvalue on the interrupting signal.
nanosleep() function returns because the requested duration has elapsed, the value returned will be zero.
nanosleep() function returns due to
the delivery of a signal, the value returned will be -1, and the global
variable errno will be set to indicate the
interruption. If remainder is non-null, the timespec
structure it references is updated to contain the unslept amount (the
requested duration minus the duration actually slept).
nanosleep() function shall return -1 and set errno to the corresponding value.
nanosleep() was interrupted by the delivery of a signal.
nanosleep() function conforms to IEEE Std 1003.1-2008 (“POSIX.1”).
sleep(), appeared in Version 3 AT&T UNIX, but was removed when alarm(3) was introduced into Version 7 AT&T UNIX. The
nanosleep() system call has been available since NetBSD 1.3 and was ported to OpenBSD 2.1 and FreeBSD 3.0.
|December 31, 2018||OpenBSD-current|