Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ sleep(3) — Ultrix-11 3.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

alarm(2)

pause(2)

signal(2)

sleep(3)

NAME

sleep − suspend execution for interval

SYNTAX

unsigned sleep(seconds)
unsigned seconds;

DESCRIPTION

The current process is suspended from execution for the number of seconds specified by the argument.  The actual suspension time may be up to 1 second less than that requested, because scheduled wakeups occur at fixed 1-second intervals, and an arbitrary amount longer because 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 the caller had an alarm set to go off earlier than the end of the requested sleep time, or premature arousal due to another caught signal. 

The routine is implemented by setting an alarm clock signal and pausing until it occurs.  The previous state of this signal is saved and restored.  If the sleep time exceeds the time to the alarm signal, the process sleeps only until the signal would have occurred, and the signal is sent 1 second later. 

SEE ALSO

alarm(2), pause(2), signal(2)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026