xref: /illumos-gate/usr/src/man/man3c/usleep.3c (revision 24f5a37652e188ebdcdd6da454511686935025df)
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. The actual suspension
26time might be less than requested because any caught signal will terminate
27.Fn usleep
28following execution of that signal's catching routine. The
29suspension time might be longer than requested by an arbitrary amount because
30of the scheduling of other activity in the system.
31.Lp
32If the value of
33.Fa useconds
34is 0, then the call has no effect.
35.Lp
36The use of the
37usleep
38function has no effect on the action or blockage
39of any signal. In a multithreaded process, only the invoking thread is
40suspended from execution.
41.Sh RETURN VALUES
42On completion,
43.Fn usleep
44returns 0. There are no error returns.
45.Sh ERRORS
46No errors are returned.
47.Sh USAGE
48The
49.Fn usleep
50function is included for its historical usage and is Obsolete.  The
51.Xr nanosleep 3C
52function is preferred over this function.
53.Sh INTERFACE STABILITY
54.Sy Obsolete Standard .
55.Sh MT-LEVEL
56.Sy Safe .
57.Sh SEE ALSO
58.Xr nanosleep 3C ,
59.Xr sleep 3C ,
60.Xr unistd.h 3HEAD ,
61.Xr standards 5
62.Sh STANDARDS
63The
64.Fn usleep
65function is available in the following compilation environments.  See
66.Xr standards 5 .
67.Lp
68.Bl -bullet -compact
69.It
70.St -xpg4.2
71.It
72.St -susv2
73.It
74.St -susv3
75.El
76.Lp
77It is marked obsolete in
78.St -susv3 , and was removed from
79.St -p1003.1-2008 .
80