nap(3C)


nap -- suspend execution for a short interval

Synopsis

   cc [flag . . . ] flag . . .
   long nap(long period);

Description

The current process is suspended from execution for at least the number of milliseconds specified by period, or until a signal is received.

Return values

On successful completion, a long integer indicating the number of milliseconds actually slept is returned. On failure, nap returns -1 and sets errno to identify the error.

Errors

In the following conditions, nap fails and sets errno to:

EAGAIN
The system lacked resources necessary to perform the operation. Subsequent attempts may succeed.

EINTR
The process received a signal while napping.

EINVAL
The period argument is negative or greater than the maximum permissible value (which is system dependent, but represents an interval of several hours).

References

sleep(3C)

Notices

This function is driven by the system clock, which in most cases has a granularity of tens of milliseconds.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004