<sys/time.h> becomes <time.h>
[unix-history] / usr / src / lib / libc / gen / sleep.3
... / ...
CommitLineData
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.\"
5.\" @(#)sleep.3 6.1 (Berkeley) %G%
6.\"
7.TH SLEEP 3 ""
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
24The routine is implemented by setting an interval timer
25and pausing until it occurs.
26The previous state of this timer is saved and restored.
27If the sleep time exceeds the time to the expiration of the
28previous timer,
29the process sleeps only until the signal would have occurred, and the
30signal is sent 1 second later.
31.SH "SEE ALSO"
32setitimer(2), sigpause(2)
33.SH BUGS
34An interface with finer resolution is needed.