summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1998-02-13 04:44:49 +0000
committerBruce Evans <bde@FreeBSD.org>1998-02-13 04:44:49 +0000
commit768950348d2a1c9de0153cfd7736656cad060263 (patch)
tree956a4e1d95352e1ec8c6a613bf9cf18adb3ee169 /lib
parentf44298df594c9734102be41cce94945db23f007e (diff)
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/usleep.352
1 files changed, 17 insertions, 35 deletions
diff --git a/lib/libc/gen/usleep.3 b/lib/libc/gen/usleep.3
index a56c56bdd545..0b2492940e4e 100644
--- a/lib/libc/gen/usleep.3
+++ b/lib/libc/gen/usleep.3
@@ -30,50 +30,38 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)usleep.3 8.1 (Berkeley) 6/4/93
+.\" $Id$
.\"
-.Dd June 4, 1993
+.Dd Feb 13, 1998
.Dt USLEEP 3
.Os BSD 4.3
.Sh NAME
.Nm usleep
-.Nd suspend execution for interval of microseconds
+.Nd suspend process execution for an interval measured in microseconds
.Sh SYNOPSIS
.Fd #include <unistd.h>
.Ft int
-.Fn usleep "u_int microseconds"
+.Fn usleep "unsigned int microseconds"
.Sh DESCRIPTION
The
.Fn usleep
-function
-suspends execution of the calling process
-for
-.Fa microseconds
-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 unaltered by
-this
-.Fn usleep
-implementation.
-If the value
+function suspends execution of the calling process until either
.Fa microseconds
-is more than or equal to the remaining clock time for the running timer,
-the sleep time is set to
-the remaining clock time.
+microseconds have elapsed or a signal is delivered to the process and its
+action is to invoke a signal-catching function or to terminate the
+process.
+System activity may lengthen the sleep by an indeterminate amount.
.Pp
This function is implemented using
.Xr nanosleep 2
by pausing for
.Fa microseconds
-of time or until any signal occurse.
+microseconds or until a signal occurs.
+Consequently, in this implementation,
+sleeping has no effect on the state of process timers,
+and there is no special handling for SIGALRM.
.Sh RETURN VALUES
-The
-.Fn usleep
-function returns 0 on successful completion. Otherwise, it returns -1
-and sets
-.Va errno
-to indicate the error.
+.Rv -std usleep
.Sh ERRORS
The
.Fn usleep
@@ -81,17 +69,11 @@ function
will fail if:
.Bl -tag -width [EINTR]
.It Bq Er EINTR
-Some signal occurse.
-.Sh NOTES
-.Pp
-A microsecond is 0.000001 seconds.
+A signal was delivered to the process and its
+action was to invoke a signal-catching function.
.Sh SEE ALSO
.Xr nanosleep 2 ,
-.Xr setitimer 2 ,
-.Xr alarm 3 ,
-.Xr signal 3 ,
-.Xr sleep 3 ,
-.Xr ualarm 3
+.Xr sleep 3
.Sh HISTORY
The
.Fn usleep