*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: nanosleep | Section: 2 | Source: OpenBSD | File: nanosleep.2
NANOSLEEP(2) FreeBSD System Calls Manual NANOSLEEP(2) NAME nanosleep - high resolution sleep SYNOPSIS #include <time.h> int nanosleep(const struct timespec *timeout, struct timespec *remainder); DESCRIPTION The nanosleep() function suspends execution of the calling thread for at least the given timeout. Delivery of an unmasked signal terminates this sleep early, even if SA_RESTART is set with sigaction(2) for the interrupting signal. RETURN VALUES If nanosleep() sleeps the full timeout without interruption, it returns 0. Unless remainder is NULL, it is set to zero. If nanosleep() is interrupted by a signal, it returns -1 and the global variable errno is set to EINTR. Unless remainder is NULL, it is set to the unslept portion of the timeout. Otherwise, nanosleep() returns -1 and the global variable errno is set to indicate the error. ERRORS nanosleep() will fail if: [EINTR] The call is interrupted by the delivery of a signal. [EINVAL] timeout specifies a nanosecond value less than zero or greater than or equal to one billion, or a second value less than zero. [EFAULT] timeout points to memory that is not a valid part of the process address space. [EFAULT] remainder is not NULL and points to memory that is not a valid part of the process address space. SEE ALSO sleep(1), sigaction(2), sleep(3) STANDARDS The nanosleep() function conforms to IEEE Std 1003.1-2008 ("POSIX.1"). HISTORY The predecessor of this system call, sleep(), first appeared in Version 2 AT&T UNIX. It was removed in Version 7 AT&T UNIX and replaced with a C library implementation based on alarm(3) and signal(3). The nanosleep() function first appeared in IEEE Std 1003.1b-1993 ("POSIX.1b"). This implementation of nanosleep() first appeared in NetBSD 1.3 and was ported to OpenBSD 2.1. FreeBSD 14.1-RELEASE-p8 March 31, 2022 FreeBSD 14.1-RELEASE-p8

Navigation Options