1*66492cf0SYuri Pankov.\" 2*66492cf0SYuri Pankov.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for 3*66492cf0SYuri Pankov.\" permission to reproduce portions of its copyrighted documentation. 4*66492cf0SYuri Pankov.\" Original documentation from The Open Group can be obtained online at 5c10c16deSRichard Lowe.\" http://www.opengroup.org/bookstore/. 6*66492cf0SYuri Pankov.\" 7*66492cf0SYuri Pankov.\" The Institute of Electrical and Electronics Engineers and The Open 8*66492cf0SYuri Pankov.\" Group, have given us permission to reprint portions of their 9*66492cf0SYuri Pankov.\" documentation. 10*66492cf0SYuri Pankov.\" 11*66492cf0SYuri Pankov.\" In the following statement, the phrase ``this text'' refers to portions 12*66492cf0SYuri Pankov.\" of the system documentation. 13*66492cf0SYuri Pankov.\" 14*66492cf0SYuri Pankov.\" Portions of this text are reprinted and reproduced in electronic form 15*66492cf0SYuri Pankov.\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition, 16*66492cf0SYuri Pankov.\" Standard for Information Technology -- Portable Operating System 17*66492cf0SYuri Pankov.\" Interface (POSIX), The Open Group Base Specifications Issue 6, 18*66492cf0SYuri Pankov.\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics 19*66492cf0SYuri Pankov.\" Engineers, Inc and The Open Group. In the event of any discrepancy 20*66492cf0SYuri Pankov.\" between these versions and the original IEEE and The Open Group 21*66492cf0SYuri Pankov.\" Standard, the original IEEE and The Open Group Standard is the referee 22*66492cf0SYuri Pankov.\" document. The original Standard can be obtained online at 23*66492cf0SYuri Pankov.\" http://www.opengroup.org/unix/online.html. 24*66492cf0SYuri Pankov.\" 25c10c16deSRichard Lowe.\" This notice shall appear on any product containing this material. 26*66492cf0SYuri Pankov.\" 27*66492cf0SYuri Pankov.\" The Berkeley software License Agreement specifies the terms and conditions 28*66492cf0SYuri Pankov.\" for redistribution. 29*66492cf0SYuri Pankov.\" 30*66492cf0SYuri Pankov.\" 31*66492cf0SYuri Pankov.\" Copyright (c) 1980 Regents of the University of California. 32*66492cf0SYuri Pankov.\" All rights reserved. 33*66492cf0SYuri Pankov.\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved. 34*66492cf0SYuri Pankov.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved. 35*66492cf0SYuri Pankov.\" Copyright 2014 Garrett D'Amore <garrett@damore.org> 36*66492cf0SYuri 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 , 9308eb1913SGarrett D'Amore.Xr standards 5 9408eb1913SGarrett D'Amore.Sh STANDARDS 9508eb1913SGarrett D'AmoreThe 9608eb1913SGarrett D'Amore.Fn usleep 9772d3dbb9SYuri Pankovfunction is available in the following compilation environments. 9872d3dbb9SYuri PankovSee 9908eb1913SGarrett D'Amore.Xr standards 5 . 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