usleep man page on OpenBSD

Man page or keyword search:  
man Server   11362 pages
apropos Keyword Search (all sections)
Output format
OpenBSD logo
[printable version]

USLEEP(3)		  OpenBSD Programmer's Manual		     USLEEP(3)

NAME
     usleep - suspend execution for interval of microseconds

SYNOPSIS
     #include <unistd.h>

     int
     usleep(useconds_t microseconds);

DESCRIPTION
     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
     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
     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]	   microseconds specified a value of 1,000,000 or more
		   microseconds.

NOTES
     A microsecond is 0.000001 seconds.

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

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

HISTORY
     The usleep() function appeared in 4.3BSD.

OpenBSD 4.9		       October 24, 2008			   OpenBSD 4.9
[top]

List of man pages available for OpenBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net