SLEEP(3C) SLEEP(3C)
sleep - suspend execution for interval
#include <unistd.h>
unsigned sleep (unsigned seconds);
The current thread is suspended from execution for the number of seconds
specified by the argument. The actual suspension time may be less than
that requested because any caught signal will terminate the sleep
following execution of that signal's catching routine. Also, the
suspension time may be longer than requested by an arbitrary amount due
to the scheduling of other activity in the system. The value returned by
sleep will be the ``unslept'' amount (the requested time minus the time
actually slept) in case of premature arousal due to a caught signal.
Unlike previous implementations, sleep is implemented with the sginap(2)
system call rather than with alarm(2). Therefore, there are no unusual
side effects with the SIGALRM signal; its effect is like that of any
other signal.
alarm(2), sginap(2), pause(2), sigaction(2), sigset(2)
PPPPaaaaggggeeee 1111 [ Back ]
|