From c08d50f5edc8557c7dbb4b4f8a075f9acbf9842b Mon Sep 17 00:00:00 2001 From: kstailey Date: Fri, 25 Apr 1997 14:48:00 +0000 Subject: less inaccurate --- lib/libc/gen/usleep.3 | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/lib/libc/gen/usleep.3 b/lib/libc/gen/usleep.3 index 97cfa2adc6e..b8ff9be759f 100644 --- a/lib/libc/gen/usleep.3 +++ b/lib/libc/gen/usleep.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: usleep.3,v 1.2 1996/08/19 08:27:18 tholo Exp $ +.\" $OpenBSD: usleep.3,v 1.3 1997/04/25 14:47:59 kstailey Exp $ .\" .\" Copyright (c) 1986, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -52,32 +52,25 @@ of time. System activity or time spent in processing the call may lengthen the sleep slightly. .Pp -If a timer is already running on the process its state is saved. -If the value -.Fa microseconds -is more than or equal to the remaining clock time for the saved timer, -the sleep time is set to -the remaining clock time. -The state of the previous timer -is restored after -.Fa microseconds -has passed. -.Pp This routine is implemented using -.Xr setitimer 2 ; -it requires eight system calls each time it is invoked. +.Xr nanosleep 2 ; +it requires one system call each time it is invoked. A similar but less compatible function can be obtained with a single .Xr select 2 ; -such a function would not restart after signals, but would not interfere +such a function would not restart after signals, and also does not interfere with other uses of -.Xr setitimer . +.Xr setitimer +(not that +.Fn usleep +interferes with interval timers anymore.) .Sh SEE ALSO -.Xr setitimer 2 , .Xr getitimer 2 , +.Xr nanosleep 2 , +.Xr setitimer 2 , .Xr sigpause 2 , -.Xr ualarm 3 , -.Xr sleep 3 , .Xr alarm 3 +.Xr sleep 3 , +.Xr ualarm 3 , .Sh HISTORY The .Fn usleep -- cgit v1.2.3