sleep()

suspend calling thread for seconds of clock time 

Function


SYNOPSIS

#include <unistd.h>

unsigned int sleep(unsigned int period);


DESCRIPTION

The sleep() function suspends the calling thread until either the number of real-time seconds specified by period has elapsed or a signal is delivered to the calling thread. The suspension time may be longer than requested because of the scheduling of other activity by the system.


PARAMETERS

period 

Is the number of real-time (as opposed to CPU-time) seconds to suspend the calling thread.


RETURN VALUES

If the requested time has elapsed, sleep() returns a value of zero. If a signal was delivered, sleep() returns the remaining seconds to sleep.


CONFORMANCE

POSIX.1 (1996).


MULTITHREAD SAFETY LEVEL

Async-signal-safe.


PORTING ISSUES

sleep() is implemented using an interruptible wait function, and does not use signals. Hence there are no interactions with SIGALRM handling, or with any other wait function (for example, usleep()), as there are on some UNIX platforms.

sleep() can be configured to wake the system from a suspended power conservation mode when the specified interval expires. See _NutConf() for more details.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
_NutConf(), alarm(), getitimer(), kill(), nanosleep(), nap(), pause(), sigaction(), signal(), sigpause(), usleep()


PTC MKS Toolkit 10.5 Documentation Build 40.