Describe signal handling. Don't describe the old implementation. Don't

define `microsecond'.  Cleaned up English.

Obtained from:	mostly from sleep.3
This commit is contained in:
Bruce Evans 1998-02-13 04:44:49 +00:00
parent f44298df59
commit 768950348d

View File

@ -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
function suspends execution of the calling process until either
.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
.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