Commit | Line | Data |
---|---|---|
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 | .\" | |
30822673 | 5 | .\" @(#)sleep.3 6.2 (Berkeley) %G% |
bb5fd2c3 | 6 | .\" |
f6a0c63d | 7 | .TH SLEEP 3 "" |
bb5fd2c3 KM |
8 | .UC 4 |
9 | .SH NAME | |
10 | sleep \- suspend execution for interval | |
11 | .SH SYNOPSIS | |
12 | .nf | |
13 | .B sleep(seconds) | |
14 | .B unsigned seconds; | |
15 | .fi | |
16 | .SH DESCRIPTION | |
17 | The current process is suspended from execution for the number | |
18 | of seconds specified by the argument. | |
19 | The actual suspension time may be up to 1 second less than | |
20 | that requested, because scheduled wakeups occur at fixed 1-second intervals, | |
21 | and an arbitrary amount longer because of other activity | |
22 | in the system. | |
23 | .PP | |
2d7b8da8 | 24 | The routine is implemented by setting an interval timer |
bb5fd2c3 | 25 | and pausing until it occurs. |
2d7b8da8 KM |
26 | The previous state of this timer is saved and restored. |
27 | If the sleep time exceeds the time to the expiration of the | |
28 | previous timer, | |
bb5fd2c3 KM |
29 | the process sleeps only until the signal would have occurred, and the |
30 | signal is sent 1 second later. | |
31 | .SH "SEE ALSO" | |
30822673 | 32 | setitimer(2), sigpause(2), usleep(3) |