USLEEP(3)

NAME
usleep - suspend execution for interval of microseconds

LIBRARY
libc

SYNOPSIS
#include <unistd.h>
int
usleep(useconds_t microseconds);

DESCRIPTION
The usleep() function suspends execution of the calling process until either the number of microseconds specified by microseconds have elapsed or a signal is delivered to the calling process and its action is to invoke a signal catching function or to terminate the process. The suspension time may be longer than requested due to the scheduling of other activity by the system.

The microseconds argument must be less than 1,000,000. If The value of microseconds is 0, then the call has no effect.

RETURN VALUE
On successful completition, usleep() returns 0. Otherwhise, it returns -1 and sets errno to indicate the error.

ERRORS
The usleep() function may fail if:

[EINVAL]
    The microseconds interval specified 1,000,000 or more microseconds.

SEE ALSO
nanosleep(2), sleep(3)

STANDARDS
The usleep() function conforms to xpg4.2.

HISTORY
The usleep() function appeared in 4.3BSD.