*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->OpenBSD man pages -> usleep (3)              
Title
Content
Arch
Section
 

USLEEP(3)

Contents


NAME    [Toc]    [Back]

     usleep - suspend execution for interval of microseconds

SYNOPSIS    [Toc]    [Back]

     #include <unistd.h>

     int
     usleep(useconds_t microseconds);

DESCRIPTION    [Toc]    [Back]

     The usleep() function suspends execution of the calling process for
     microseconds  microseconds of time.  System activity or time
spent in processing
 the call may lengthen the sleep slightly.

     This routine is implemented using nanosleep(2); it  requires
one system
     call each time it is invoked.  A similar but less compatible
function can
     be obtained with a single select(2); such a  function  would
not restart
     after  signals,  and also does not interfere with other uses
of
     setitimer(2) (not that  usleep()  interferes  with  interval
timers anymore).

RETURN VALUES    [Toc]    [Back]

     If  the usleep() function returns because the requested time
has elapsed,
     the value returned will be zero.

     If the usleep() function returns due to the  delivery  of  a
signal, the
     value  returned  will  be  -1, and the global variable errno
will be set to
     indicate the interruption.

ERRORS    [Toc]    [Back]

     If any of the following conditions occur, the usleep() function shall return
 -1 and set errno to the corresponding value.

     [EINTR]        usleep() was interrupted by the delivery of a
signal.

     [EINVAL]      useconds specified a  value  of  1,000,000  or
more microseconds.

NOTES    [Toc]    [Back]

     A microsecond is 0.000001 seconds.

SEE ALSO    [Toc]    [Back]

      
      
     getitimer(2),  nanosleep(2),  setitimer(2),  alarm(3),  sigpause(3),
     sleep(3), ualarm(3)

STANDARDS    [Toc]    [Back]

     The usleep() function conforms to X/Open  Portability  Guide
Issue 4.2
     (``XPG4.2'').

HISTORY    [Toc]    [Back]

     The usleep() function appeared in 4.3BSD.

OpenBSD      3.6                         November     4,     1997
[ Back ]
 Similar pages
Name OS Title
usleep FreeBSD suspend process execution for an interval measured in microseconds
sleep IRIX suspend execution for an interval
sleep HP-UX suspend execution for an interval
usleep HP-UX suspend execution for an interval
sleep IRIX suspend execution for interval
usleep IRIX suspend execution for an interval
usleep Tru64 Suspend execution for an interval of time
sleep OpenBSD suspend execution for an interval of time
sleep Tru64 Suspend execution for an interval of time
sleep FreeBSD suspend execution for an interval of time
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service