diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:40:15 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:40:15 +0000 |
commit | 399644e47874bff147afb19c89228901ac39340e (patch) | |
tree | 1c4c0b733f4c16b5783b41bebb19194a9ef62ad1 /man3/usleep.3 | |
parent | Initial commit. (diff) | |
download | manpages-399644e47874bff147afb19c89228901ac39340e.tar.xz manpages-399644e47874bff147afb19c89228901ac39340e.zip |
Adding upstream version 6.05.01.upstream/6.05.01
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'man3/usleep.3')
-rw-r--r-- | man3/usleep.3 | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/man3/usleep.3 b/man3/usleep.3 new file mode 100644 index 0000000..a05472d --- /dev/null +++ b/man3/usleep.3 @@ -0,0 +1,124 @@ +'\" t +.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) +.\" +.\" SPDX-License-Identifier: Linux-man-pages-copyleft +.\" +.\" References consulted: +.\" Linux libc source code +.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) +.\" 386BSD man pages +.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) +.\" Modified 2001-04-01 by aeb +.\" Modified 2003-07-23 by aeb +.\" +.TH usleep 3 2023-07-20 "Linux man-pages 6.05.01" +.SH NAME +usleep \- suspend execution for microsecond intervals +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.B "#include <unistd.h>" +.PP +.BI "int usleep(useconds_t " usec ); +.fi +.PP +.RS -4 +Feature Test Macro Requirements for glibc (see +.BR feature_test_macros (7)): +.RE +.PP +.BR usleep (): +.nf + Since glibc 2.12: + (_XOPEN_SOURCE >= 500) && ! (_POSIX_C_SOURCE >= 200809L) + || /* glibc >= 2.19: */ _DEFAULT_SOURCE + || /* glibc <= 2.19: */ _BSD_SOURCE + Before glibc 2.12: + _BSD_SOURCE || _XOPEN_SOURCE >= 500 +.\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED +.fi +.SH DESCRIPTION +The +.BR usleep () +function suspends execution of the calling thread for +(at least) \fIusec\fP microseconds. +The sleep may be lengthened slightly +by any system activity or by the time spent processing the call or by the +granularity of system timers. +.SH RETURN VALUE +The +.BR usleep () +function returns 0 on success. +On error, \-1 is returned, with +.I errno +set to indicate the error. +.SH ERRORS +.TP +.B EINTR +Interrupted by a signal; see +.BR signal (7). +.TP +.B EINVAL +\fIusec\fP is greater than or equal to 1000000. +(On systems where that is considered an error.) +.SH ATTRIBUTES +For an explanation of the terms used in this section, see +.BR attributes (7). +.TS +allbox; +lbx lb lb +l l l. +Interface Attribute Value +T{ +.na +.nh +.BR usleep () +T} Thread safety MT-Safe +.TE +.sp 1 +.SH STANDARDS +None. +.SH HISTORY +4.3BSD, POSIX.1-2001. +POSIX.1-2001 declares it obsolete, suggesting +.BR nanosleep (2) +instead. +Removed in POSIX.1-2008. +.PP +On the original BSD implementation, +and before glibc 2.2.2, the return type of this function is +.IR void . +The POSIX version returns +.IR int , +and this is also the prototype used since glibc 2.2.2. +.PP +Only the +.B EINVAL +error return is documented by SUSv2 and POSIX.1-2001. +.SH CAVEATS +The interaction of this function with the +.B SIGALRM +signal, and with other timer functions such as +.BR alarm (2), +.BR sleep (3), +.BR nanosleep (2), +.BR setitimer (2), +.BR timer_create (2), +.BR timer_delete (2), +.BR timer_getoverrun (2), +.BR timer_gettime (2), +.BR timer_settime (2), +.BR ualarm (3) +is unspecified. +.SH SEE ALSO +.BR alarm (2), +.BR getitimer (2), +.BR nanosleep (2), +.BR select (2), +.BR setitimer (2), +.BR sleep (3), +.BR ualarm (3), +.BR useconds_t (3type), +.BR time (7) |