summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/usleep.3
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-08-12 17:53:00 +0000
committerache <ache@FreeBSD.org>1997-08-12 17:53:00 +0000
commit3451ae1ca3ed1ea94a33aaa30c1a91992e4dd2c2 (patch)
treea405f45c4c8a0dcd70230bdfa26cc70f2f6ab8c8 /lib/libc/gen/usleep.3
parent0f99da1026ed0bc78fd3883bdb217f6a210bf0ed (diff)
downloadFreeBSD-src-3451ae1ca3ed1ea94a33aaa30c1a91992e4dd2c2.zip
FreeBSD-src-3451ae1ca3ed1ea94a33aaa30c1a91992e4dd2c2.tar.gz
Reflect -current implementations
Diffstat (limited to 'lib/libc/gen/usleep.3')
-rw-r--r--lib/libc/gen/usleep.331
1 files changed, 15 insertions, 16 deletions
diff --git a/lib/libc/gen/usleep.3 b/lib/libc/gen/usleep.3
index 66b317a..5b539f9 100644
--- a/lib/libc/gen/usleep.3
+++ b/lib/libc/gen/usleep.3
@@ -52,30 +52,29 @@ 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 a timer is already running on the process its state is unaltered by
+this
+.Fn usleep
+implementation.
If the value
.Fa microseconds
-is more than or equal to the remaining clock time for the saved timer,
+is more than or equal to the remaining clock time for the running timer,
the sleep time is set to
the remaining clock time.
-The state of the previous timer
-is restored after
+.Pp
+This function is implemented using
+.Xr signanosleep 2
+by pausing for
.Fa microseconds
-has passed.
+of time or until SIGALRM signal occurse.
+.Sh NOTES
.Pp
-This routine is implemented using
-.Xr setitimer 2 ;
-it requires eight system calls 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
-with other uses of
-.Xr setitimer .
+A microsecond is 0.000001 seconds.
.Sh SEE ALSO
-.Xr getitimer 2 ,
-.Xr setitimer 2 ,
-.Xr sigpause 2 ,
.Xr alarm 3 ,
+.Xr setitimer 2 ,
+.Xr signal 3 ,
+.Xr signanosleep 2 ,
.Xr sleep 3 ,
.Xr ualarm 3
.Sh HISTORY
OpenPOWER on IntegriCloud