HPlogo MPE/iX Developer's Kit Reference Manual Volume I: HP 3000 MPE/iX Computer Systems > Chapter 4  POSIX/iX Library Function Descriptions

sleep

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Delays process execution.

Syntax

   #include <unistd.h>

   unsigned int sleep (unsigned int seconds);

Parameters

seconds

Specifies the number of real time seconds to sleep.

Return Values

No return

If the action associated with a signal is to terminate, sleep() does not return.

0

The requested time has elapsed.

>0

The difference between seconds and the actual number of seconds slept before delivery of a signal whose action is to execute a signal handling function.

Description

The sleep() function suspends the calling process from execution either for the number of real-time seconds specified by the seconds parameter or until the delivery of a signal whose action is either to execute a signal-handling function or to terminate the process.

If seconds real-time seconds have passed without receipt of a signal with the appropriate action, sleep() returns control to the calling process.

If the action associated with a received signal is to execute a signal handling function, upon completion of the function, sleep() returns control to the calling process. If the signal action is to terminate the process, sleep() does not return.

Due to system activity, the process may be suspended for more than the number of real-time seconds indicated by the seconds parameter.

Implementation Considerations

The SIGALRM signal is not used to implement sleep().

Errors

None.

See Also

alarm(), pause(), sigaction(), POSIX.1 (Section 3.4.3).

Feedback to webmaster