USLEEP(3C) Standard C Library Functions USLEEP(3C)

NAME


usleep - suspend execution for interval in microseconds

SYNOPSIS


#include <unistd.h>

int
usleep(useconds_t useconds);

DESCRIPTION


The usleep() function suspends the caller from execution for the number of
microseconds specified by the useconds argument. The actual suspension
time might be less than requested because any caught signal will terminate
usleep() following execution of that signal's catching routine. The
suspension time might be longer than requested by an arbitrary amount
because of the scheduling of other activity in the system.

If the value of useconds is 0, then the call has no effect.

The use of the usleep function has no effect on the action or blockage of
any signal. In a multithreaded process, only the invoking thread is
suspended from execution.

RETURN VALUES


On completion, usleep() returns 0. There are no error returns.

ERRORS


No errors are returned.

USAGE


The usleep() function is included for its historical usage and is Obsolete.
The nanosleep(3C) function is preferred over this function.

INTERFACE STABILITY


Obsolete Standard.

MT-LEVEL
Safe.

SEE ALSO


nanosleep(3C), sleep(3C), unistd.h(3HEAD), standards(7)

STANDARDS


The usleep() function is available in the following compilation
environments. See standards(7).

+o X/Open Portability Guide Issue 4, Version 2 ("XPG4.2")
+o Version 2 of the Single UNIX Specification ("SUSv2")
+o Version 3 of the Single UNIX Specification ("SUSv3")

It is marked obsolete in Version 3 of the Single UNIX Specification
("SUSv3"), and was removed from IEEE Std 1003.1-2008 ("POSIX.1").

illumos August 16, 2014 illumos