xref: /illumos-gate/usr/src/man/man3c/usleep.3c (revision bbf215553c7233fbab8a0afdf1fac74c44781867)
166492cf0SYuri Pankov.\"
266492cf0SYuri Pankov.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
366492cf0SYuri Pankov.\" permission to reproduce portions of its copyrighted documentation.
466492cf0SYuri Pankov.\" Original documentation from The Open Group can be obtained online at
5c10c16deSRichard Lowe.\" http://www.opengroup.org/bookstore/.
666492cf0SYuri Pankov.\"
766492cf0SYuri Pankov.\" The Institute of Electrical and Electronics Engineers and The Open
866492cf0SYuri Pankov.\" Group, have given us permission to reprint portions of their
966492cf0SYuri Pankov.\" documentation.
1066492cf0SYuri Pankov.\"
1166492cf0SYuri Pankov.\" In the following statement, the phrase ``this text'' refers to portions
1266492cf0SYuri Pankov.\" of the system documentation.
1366492cf0SYuri Pankov.\"
1466492cf0SYuri Pankov.\" Portions of this text are reprinted and reproduced in electronic form
1566492cf0SYuri Pankov.\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
1666492cf0SYuri Pankov.\" Standard for Information Technology -- Portable Operating System
1766492cf0SYuri Pankov.\" Interface (POSIX), The Open Group Base Specifications Issue 6,
1866492cf0SYuri Pankov.\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
1966492cf0SYuri Pankov.\" Engineers, Inc and The Open Group.  In the event of any discrepancy
2066492cf0SYuri Pankov.\" between these versions and the original IEEE and The Open Group
2166492cf0SYuri Pankov.\" Standard, the original IEEE and The Open Group Standard is the referee
2266492cf0SYuri Pankov.\" document.  The original Standard can be obtained online at
2366492cf0SYuri Pankov.\" http://www.opengroup.org/unix/online.html.
2466492cf0SYuri Pankov.\"
25c10c16deSRichard Lowe.\" This notice shall appear on any product containing this material.
2666492cf0SYuri Pankov.\"
2766492cf0SYuri Pankov.\" The Berkeley software License Agreement specifies the terms and conditions
2866492cf0SYuri Pankov.\" for redistribution.
2966492cf0SYuri Pankov.\"
3066492cf0SYuri Pankov.\"
3166492cf0SYuri Pankov.\" Copyright (c) 1980 Regents of the University of California.
3266492cf0SYuri Pankov.\" All rights reserved.
3366492cf0SYuri Pankov.\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved.
3466492cf0SYuri Pankov.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
3566492cf0SYuri Pankov.\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
3666492cf0SYuri Pankov.\"
3708eb1913SGarrett D'Amore.Dd "Aug 16, 2014"
3808eb1913SGarrett D'Amore.Dt USLEEP 3C
3908eb1913SGarrett D'Amore.Os
4008eb1913SGarrett D'Amore.Sh NAME
4108eb1913SGarrett D'Amore.Nm usleep
4208eb1913SGarrett D'Amore.Nd suspend execution for interval in microseconds
4308eb1913SGarrett D'Amore.Sh SYNOPSIS
4408eb1913SGarrett D'Amore.In unistd.h
4508eb1913SGarrett D'Amore.Ft int
4608eb1913SGarrett D'Amore.Fn usleep "useconds_t useconds"
4708eb1913SGarrett D'Amore.Sh DESCRIPTION
4808eb1913SGarrett D'AmoreThe
4908eb1913SGarrett D'Amore.Fn usleep
5008eb1913SGarrett D'Amorefunction suspends the caller from execution for the number
5108eb1913SGarrett D'Amoreof microseconds specified by the
5208eb1913SGarrett D'Amore.Fa useconds
5372d3dbb9SYuri Pankovargument.
5472d3dbb9SYuri PankovThe actual suspension time might be less than requested because any caught
5572d3dbb9SYuri Pankovsignal will terminate
5608eb1913SGarrett D'Amore.Fn usleep
5772d3dbb9SYuri Pankovfollowing execution of that signal's catching routine.
5872d3dbb9SYuri PankovThe suspension time might be longer than requested by an arbitrary amount
5972d3dbb9SYuri Pankovbecause of the scheduling of other activity in the system.
6008eb1913SGarrett D'Amore.Lp
6108eb1913SGarrett D'AmoreIf the value of
6208eb1913SGarrett D'Amore.Fa useconds
6308eb1913SGarrett D'Amoreis 0, then the call has no effect.
6408eb1913SGarrett D'Amore.Lp
6508eb1913SGarrett D'AmoreThe use of the
6608eb1913SGarrett D'Amoreusleep
6708eb1913SGarrett D'Amorefunction has no effect on the action or blockage
6872d3dbb9SYuri Pankovof any signal.
6972d3dbb9SYuri PankovIn a multithreaded process, only the invoking thread is suspended from
7072d3dbb9SYuri Pankovexecution.
7108eb1913SGarrett D'Amore.Sh RETURN VALUES
7208eb1913SGarrett D'AmoreOn completion,
7308eb1913SGarrett D'Amore.Fn usleep
7472d3dbb9SYuri Pankovreturns 0.
7572d3dbb9SYuri PankovThere are no error returns.
7608eb1913SGarrett D'Amore.Sh ERRORS
77c10c16deSRichard LoweNo errors are returned.
7808eb1913SGarrett D'Amore.Sh USAGE
7908eb1913SGarrett D'AmoreThe
8008eb1913SGarrett D'Amore.Fn usleep
8172d3dbb9SYuri Pankovfunction is included for its historical usage and is Obsolete.
8272d3dbb9SYuri PankovThe
8308eb1913SGarrett D'Amore.Xr nanosleep 3C
8408eb1913SGarrett D'Amorefunction is preferred over this function.
8508eb1913SGarrett D'Amore.Sh INTERFACE STABILITY
8608eb1913SGarrett D'Amore.Sy Obsolete Standard .
8708eb1913SGarrett D'Amore.Sh MT-LEVEL
8808eb1913SGarrett D'Amore.Sy Safe .
8908eb1913SGarrett D'Amore.Sh SEE ALSO
9008eb1913SGarrett D'Amore.Xr nanosleep 3C ,
9108eb1913SGarrett D'Amore.Xr sleep 3C ,
9208eb1913SGarrett D'Amore.Xr unistd.h 3HEAD ,
93*bbf21555SRichard Lowe.Xr standards 7
9408eb1913SGarrett D'Amore.Sh STANDARDS
9508eb1913SGarrett D'AmoreThe
9608eb1913SGarrett D'Amore.Fn usleep
9772d3dbb9SYuri Pankovfunction is available in the following compilation environments.
9872d3dbb9SYuri PankovSee
99*bbf21555SRichard Lowe.Xr standards 7 .
10008eb1913SGarrett D'Amore.Lp
10108eb1913SGarrett D'Amore.Bl -bullet -compact
10208eb1913SGarrett D'Amore.It
10308eb1913SGarrett D'Amore.St -xpg4.2
10408eb1913SGarrett D'Amore.It
10508eb1913SGarrett D'Amore.St -susv2
10608eb1913SGarrett D'Amore.It
10708eb1913SGarrett D'Amore.St -susv3
10808eb1913SGarrett D'Amore.El
10908eb1913SGarrett D'Amore.Lp
11008eb1913SGarrett D'AmoreIt is marked obsolete in
11108eb1913SGarrett D'Amore.St -susv3 , and was removed from
11208eb1913SGarrett D'Amore.St -p1003.1-2008 .
113