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 2007-02-01 "" "Linux Programmer's Manual"
33 usleep \- suspend execution for microsecond intervals
36 .B "#define _XOPEN_SOURCE 500 /* Or: #define _BSD_SOURCE */"
38 .B "#include <unistd.h>"
40 .BI "int usleep(useconds_t " usec );
45 function suspends execution of the calling process for
46 (at least) \fIusec\fP microseconds.
47 The sleep may be lengthened slightly
48 by any system activity or by the time spent processing the call or by the
49 granularity of system timers.
51 0 on success, \-1 on error.
55 Interrupted by a signal.
58 \fIusec\fP is not smaller than 1000000.
59 (On systems where that is considered an error.)
62 POSIX.1-2001 declares this function obsolete; use
66 On the original BSD implementation,
67 and in glibc before version 2.2.2, the return type of this function is
69 The POSIX version returns
71 and this is also the prototype used since glibc 2.2.2.
75 error return is documented by SUSv2.
79 is an unsigned integer type capable of holding integers
80 in the range [0,1000000].
81 Programs will be more portable
82 if they never mention this type explicitly.
96 The interaction of this function with the
98 signal, and with other timer functions such as
103 .BR timer_create (3),
104 .BR timer_delete (3),
105 .BR timer_getoverrun (3),
106 .BR timer_gettime (3),
107 .BR timer_settime (3),
118 .BR feature_test_macros (7),