diff options
author | bde <bde@FreeBSD.org> | 1998-02-13 04:44:49 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-02-13 04:44:49 +0000 |
commit | 85b6b2fc81ea31c73a307758182855b123d8ee06 (patch) | |
tree | 1006213d711ea24ca284c449ba29d1357526e118 /lib/libc/gen/usleep.3 | |
parent | 8fe3eebc42c2bfd32a57bce11a9fab44e80218a1 (diff) | |
download | FreeBSD-src-85b6b2fc81ea31c73a307758182855b123d8ee06.zip FreeBSD-src-85b6b2fc81ea31c73a307758182855b123d8ee06.tar.gz |
Describe signal handling. Don't describe the old implementation. Don't
define `microsecond'. Cleaned up English.
Obtained from: mostly from sleep.3
Diffstat (limited to 'lib/libc/gen/usleep.3')
-rw-r--r-- | lib/libc/gen/usleep.3 | 52 |
1 files changed, 17 insertions, 35 deletions
diff --git a/lib/libc/gen/usleep.3 b/lib/libc/gen/usleep.3 index a56c56b..0b24929 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 |