xref: /illumos-gate/usr/src/man/man3c/usleep.3c (revision bb4d45692c48b2f803f7ec1f690be050a0b2bf05)
1.\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
2.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
3.\" Copyright (c) 1980 Regents of the University of California.  All rights reserved.  The Berkeley software License Agreement specifies the terms and conditions for redistribution.
4.\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved.
5.\" 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
6.\" http://www.opengroup.org/bookstore/.
7.\" 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 Sun OS 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.
8.\"  This notice shall appear on any product containing this material.
9.Dd "Aug 16, 2014"
10.Dt USLEEP 3C
11.Os
12.Sh NAME
13.Nm usleep
14.Nd suspend execution for interval in microseconds
15.Sh SYNOPSIS
16.In unistd.h
17.Ft int
18.Fn usleep "useconds_t useconds"
19.Sh DESCRIPTION
20The
21.Fn usleep
22function suspends the caller from execution for the number
23of microseconds specified by the
24.Fa useconds
25argument.
26The actual suspension time might be less than requested because any caught
27signal will terminate
28.Fn usleep
29following execution of that signal's catching routine.
30The suspension time might be longer than requested by an arbitrary amount
31because of the scheduling of other activity in the system.
32.Lp
33If the value of
34.Fa useconds
35is 0, then the call has no effect.
36.Lp
37The use of the
38usleep
39function has no effect on the action or blockage
40of any signal.
41In a multithreaded process, only the invoking thread is suspended from
42execution.
43.Sh RETURN VALUES
44On completion,
45.Fn usleep
46returns 0.
47There are no error returns.
48.Sh ERRORS
49No errors are returned.
50.Sh USAGE
51The
52.Fn usleep
53function is included for its historical usage and is Obsolete.
54The
55.Xr nanosleep 3C
56function is preferred over this function.
57.Sh INTERFACE STABILITY
58.Sy Obsolete Standard .
59.Sh MT-LEVEL
60.Sy Safe .
61.Sh SEE ALSO
62.Xr nanosleep 3C ,
63.Xr sleep 3C ,
64.Xr unistd.h 3HEAD ,
65.Xr standards 5
66.Sh STANDARDS
67The
68.Fn usleep
69function is available in the following compilation environments.
70See
71.Xr standards 5 .
72.Lp
73.Bl -bullet -compact
74.It
75.St -xpg4.2
76.It
77.St -susv2
78.It
79.St -susv3
80.El
81.Lp
82It is marked obsolete in
83.St -susv3 , and was removed from
84.St -p1003.1-2008 .
85