<sys/time.h> becomes <time.h>
[unix-history] / usr / src / lib / libc / gen / sleep.3
CommitLineData
bb5fd2c3
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
f6a0c63d 5.\" @(#)sleep.3 6.1 (Berkeley) %G%
bb5fd2c3 6.\"
f6a0c63d 7.TH SLEEP 3 ""
bb5fd2c3
KM
8.UC 4
9.SH NAME
10sleep \- suspend execution for interval
11.SH SYNOPSIS
12.nf
13.B sleep(seconds)
14.B unsigned seconds;
15.fi
16.SH DESCRIPTION
17The current process is suspended from execution for the number
18of seconds specified by the argument.
19The actual suspension time may be up to 1 second less than
20that requested, because scheduled wakeups occur at fixed 1-second intervals,
21and an arbitrary amount longer because of other activity
22in the system.
23.PP
2d7b8da8 24The routine is implemented by setting an interval timer
bb5fd2c3 25and pausing until it occurs.
2d7b8da8
KM
26The previous state of this timer is saved and restored.
27If the sleep time exceeds the time to the expiration of the
28previous timer,
bb5fd2c3
KM
29the process sleeps only until the signal would have occurred, and the
30signal is sent 1 second later.
31.SH "SEE ALSO"
2d7b8da8
KM
32setitimer(2), sigpause(2)
33.SH BUGS
34An interface with finer resolution is needed.