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