1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
.\"
.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
.\" permission to reproduce portions of its copyrighted documentation.
.\" Original documentation from The Open Group can be obtained online at
.\" http://www.opengroup.org/bookstore/.
.\"
.\" The Institute of Electrical and Electronics Engineers and The Open
.\" Group, have given us permission to reprint portions of their
.\" documentation.
.\"
.\" In the following statement, the phrase ``this text'' refers to portions
.\" of the system documentation.
.\"
.\" Portions of this text are reprinted and reproduced in electronic form
.\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
.\" Standard for Information Technology -- Portable Operating System
.\" Interface (POSIX), The Open Group Base Specifications Issue 6,
.\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
.\" Engineers, Inc and The Open Group. In the event of any discrepancy
.\" between these versions and the original IEEE and The Open Group
.\" Standard, the original IEEE and The Open Group Standard is the referee
.\" document. The original Standard can be obtained online at
.\" http://www.opengroup.org/unix/online.html.
.\"
.\" This notice shall appear on any product containing this material.
.\"
.\" The Berkeley software License Agreement specifies the terms and conditions
.\" for redistribution.
.\"
.\"
.\" Copyright (c) 1980 Regents of the University of California.
.\" All rights reserved.
.\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved.
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
.\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
.\"
.Dd "Aug 16, 2014"
.Dt USLEEP 3C
.Os
.Sh NAME
.Nm usleep
.Nd suspend execution for interval in microseconds
.Sh SYNOPSIS
.In unistd.h
.Ft int
.Fn usleep "useconds_t useconds"
.Sh DESCRIPTION
The
.Fn usleep
function suspends the caller from execution for the number
of microseconds specified by the
.Fa useconds
argument.
The actual suspension time might be less than requested because any caught
signal will terminate
.Fn usleep
following execution of that signal's catching routine.
The suspension time might be longer than requested by an arbitrary amount
because of the scheduling of other activity in the system.
.Lp
If the value of
.Fa useconds
is 0, then the call has no effect.
.Lp
The use of the
usleep
function has no effect on the action or blockage
of any signal.
In a multithreaded process, only the invoking thread is suspended from
execution.
.Sh RETURN VALUES
On completion,
.Fn usleep
returns 0.
There are no error returns.
.Sh ERRORS
No errors are returned.
.Sh USAGE
The
.Fn usleep
function is included for its historical usage and is Obsolete.
The
.Xr nanosleep 3C
function is preferred over this function.
.Sh INTERFACE STABILITY
.Sy Obsolete Standard .
.Sh MT-LEVEL
.Sy Safe .
.Sh SEE ALSO
.Xr nanosleep 3C ,
.Xr sleep 3C ,
.Xr unistd.h 3HEAD ,
.Xr standards 5
.Sh STANDARDS
The
.Fn usleep
function is available in the following compilation environments.
See
.Xr standards 5 .
.Lp
.Bl -bullet -compact
.It
.St -xpg4.2
.It
.St -susv2
.It
.St -susv3
.El
.Lp
It is marked obsolete in
.St -susv3 , and was removed from
.St -p1003.1-2008 .
|