1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" References consulted:
24 .\" Linux libc source code
25 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
27 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified 2001-04-01 by aeb
29 .\" Modified 2003-07-23 by aeb
31 .TH USLEEP 3 2003-07-23 "" "Linux Programmer's Manual"
33 usleep \- suspend execution for microsecond intervals
37 .B "#include <unistd.h>"
39 .BI "void usleep(unsigned long " usec );
42 .B "#define _XOPEN_SOURCE 500"
44 .B "#include <unistd.h>"
46 .BI "int usleep(useconds_t " usec ");
49 The \fBusleep\fP() function suspends execution of the calling process for
50 (at least) \fIusec\fP microseconds. The sleep may be lengthened slightly
51 by any system activity or by the time spent processing the call or by the
52 granularity of system timers.
54 None (BSD). Or: 0 on success, \-1 on error (SUSv2).
58 Interrupted by a signal.
61 \fIusec\fP is not smaller than 1000000.
62 (On systems where that is considered an error.)
65 The SUSv2 version returns int, and this is also the prototype
67 Only the EINVAL error return is documented by SUSv2.
71 is an unsigned integer type capable of holding integers
72 in the range [0,1000000]. Programs will be more portable
73 if they never mention this type explicitly. Use
86 This type is defined by
90 but glibc defines it only when _XOPEN_SOURCE has a value not less than 500,
91 or both _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED are defined.
92 .\" useconds_t also gives problems on HPUX 10.
94 The interaction of this function with the SIGALRM signal, and with
95 other timer functions such as
102 .IR timer_getoverrun (),
103 .IR timer_gettime (),
104 .IR timer_settime (),
108 This function is obsolete. Use