diff options
author | jmacd <jmacd@FreeBSD.org> | 1996-04-05 05:35:57 +0000 |
---|---|---|
committer | jmacd <jmacd@FreeBSD.org> | 1996-04-05 05:35:57 +0000 |
commit | db840afbd6e1ef3927f17de11a75f182a7020c86 (patch) | |
tree | 277492b6de140d315070c9d95f83372dc2d198b5 /lib/libc/gen/sleep.3 | |
parent | 4fc02548e542b831399a27475b9288f3becac3e2 (diff) | |
download | FreeBSD-src-db840afbd6e1ef3927f17de11a75f182a7020c86.zip FreeBSD-src-db840afbd6e1ef3927f17de11a75f182a7020c86.tar.gz |
Added a note about the return value. Its been so long I can't
remember who suggested the 'caveat' section. Sorry.
Diffstat (limited to 'lib/libc/gen/sleep.3')
-rw-r--r-- | lib/libc/gen/sleep.3 | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/libc/gen/sleep.3 b/lib/libc/gen/sleep.3 index a56a80e..1016a3d 100644 --- a/lib/libc/gen/sleep.3 +++ b/lib/libc/gen/sleep.3 @@ -72,10 +72,29 @@ such a function would not restart after signals, but would not interfere with other uses of .Xr setitimer 2 . .Sh RETURN VALUES +The +.Fn sleep +function returns the number of seconds remaining to complete the operation. If +sleep is interrupted or cannot allocate a timer it may will return the value +needed to be passed to a subsequent sleep to complete the necessary delay. +.Fn sleep +repeatedly until it returns zero may busy-wait until a timer +is available. .Sh SEE ALSO .Xr setitimer 2 , .Xr sigpause 2 , .Xr usleep 3 +.Sh CAVEAT +In practice the FreeBSD implementation will not be interrupted: it will +always return the original argument or zero. Code that depends on +sleep being interrupted (using it as a timed pause, for example) needs +to be recoded to use +.Xr select 2 +or some other delay mechanism. Code that +calls +.Fn sleep +repeatedly until it returns zero may busy-wait until a timer +is available. .Sh HISTORY A .Fn sleep |