Print this page
oops, dropped leading 'f'
Minor markup tweaks (Sy instead of Nm).
fix incorrect standard citations
first round of POSIX 2008 stuff
   1 '\" te
   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 .TH USLEEP 3C "Feb 5, 2008"
  10 .SH NAME
  11 usleep \- suspend execution for interval in microseconds
  12 .SH SYNOPSIS
  13 .LP
  14 .nf
  15 #include <unistd.h>
  16 
  17 \fBint\fR \fBusleep\fR(\fBuseconds_t\fR \fIuseconds\fR);
  18 .fi
  19 
  20 .SH DESCRIPTION
  21 .sp
  22 .LP
  23 The \fBusleep()\fR function suspends the caller from execution for the number
  24 of microseconds specified by the \fIuseconds\fR argument. The actual suspension

  25 time might be less than requested because any caught signal will terminate
  26 \fBusleep()\fR following execution of that signal's catching routine. The

  27 suspension time might be longer than requested by an arbitrary amount because
  28 of the scheduling of other activity in the system.
  29 .sp
  30 .LP
  31 If the value of \fIuseconds\fR is 0, then the call has no effect.
  32 .sp
  33 .LP
  34 The use of the \fBusleep()\fR function has no effect on the action or blockage


  35 of any signal. In a multithreaded process, only the invoking thread is
  36 suspended from execution.
  37 .SH RETURN VALUES
  38 .sp
  39 .LP
  40 On completion, \fBusleep()\fR returns \fB0\fR. There are no error returns.
  41 .SH ERRORS
  42 .sp
  43 .LP
  44 No errors are returned.
  45 .SH USAGE
  46 .sp
  47 .LP
  48 The \fBusleep()\fR function is included for its historical usage.  The
  49 \fBnanosleep\fR(3C) function is preferred over this function.
  50 .SH ATTRIBUTES
  51 .sp
  52 .LP
  53 See \fBattributes\fR(5) for descriptions of the following attributes:
  54 .sp
  55 
  56 .sp
  57 .TS
  58 box;
  59 c | c
  60 l | l .
  61 ATTRIBUTE TYPE  ATTRIBUTE VALUE
  62 _
  63 Interface Stability     Committed
  64 _
  65 MT-Level        Safe
  66 _
  67 Standard        See \fBstandards\fR(5).
  68 .TE
  69 
  70 .SH SEE ALSO
  71 .sp
  72 .LP
  73 \fBnanosleep\fR(3C), \fBsleep\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)

   1 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
   2 .\" Copyright (c) 1980 Regents of the University of California.  All rights reserved.  The Berkeley software License Agreement specifies the terms and conditions for redistribution.
   3 .\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved.
   4 .\" 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
   5 .\" http://www.opengroup.org/bookstore/.
   6 .\" 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.
   7 .\"  This notice shall appear on any product containing this material.
   8 .Dd "Jul 20, 2014"
   9 .Dt USLEEP 3C
  10 .Os
  11 .Sh NAME
  12 .Nm usleep
  13 .Nd suspend execution for interval in microseconds
  14 .Sh SYNOPSIS
  15 .In unistd.h
  16 .Ft int
  17 .Fn usleep "useconds_t useconds"
  18 .Sh DESCRIPTION
  19 The
  20 .Fn usleep
  21 function suspends the caller from execution for the number
  22 of microseconds specified by the
  23 .Fa useconds
  24 argument. The actual suspension
  25 time might be less than requested because any caught signal will terminate
  26 .Fn usleep
  27 following execution of that signal's catching routine. The
  28 suspension time might be longer than requested by an arbitrary amount because
  29 of the scheduling of other activity in the system.
  30 .Lp
  31 If the value of
  32 .Fa useconds
  33 is 0, then the call has no effect.
  34 .Lp
  35 The use of the
  36 usleep
  37 function has no effect on the action or blockage
  38 of any signal. In a multithreaded process, only the invoking thread is
  39 suspended from execution.
  40 .Sh RETURN VALUES
  41 On completion,
  42 .Fn usleep
  43 returns 0. There are no error returns.
  44 .Sh ERRORS


  45 No errors are returned.
  46 .Sh USAGE
  47 The
  48 .Fn usleep
  49 function is included for its historical usage and is Obsolete.  The
  50 .Xr nanosleep 3C
  51 function is preferred over this function.
  52 .Sh INTERFACE STABILITY
  53 .Sy Obsolete Standard .
  54 .Sh MT-LEVEL
  55 .Sy Safe .
  56 .Sh SEE ALSO
  57 .Xr nanosleep 3C ,
  58 .Xr sleep 3C ,
  59 .Xr standards 5
  60 .Sh STANDARDS
  61 The
  62 .Fn usleep
  63 function was introduced in
  64 .Bx 4.3 ,
  65 and then standardized in
  66 .St -xpg4.2 .
  67 It was subsequently obsoleted in
  68 .St -p1003.1-2001 ,
  69 and removed from
  70 .St -p1003.1-2008 .