From 45ea5f3053e233c787d34a0441b2560736f53e96 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Wed, 22 Oct 1997 11:27:20 +0000 Subject: [PATCH] Reflect usleep code changes: Limit max arg Change return type to int --- lib/libc/gen/usleep.3 | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/lib/libc/gen/usleep.3 b/lib/libc/gen/usleep.3 index b5ed4e9ce292..0b03a7cff60c 100644 --- a/lib/libc/gen/usleep.3 +++ b/lib/libc/gen/usleep.3 @@ -39,7 +39,7 @@ .Nd suspend execution for interval of microseconds .Sh SYNOPSIS .Fd #include -.Ft void +.Ft int .Fn usleep "u_int microseconds" .Sh DESCRIPTION The @@ -52,6 +52,10 @@ of time. System activity or time spent in processing the call may lengthen the sleep slightly. .Pp +The +.Fa microseconds +argument must be less than 1000000. +.Pp If a timer is already running on the process its state is unaltered by this .Fn usleep @@ -67,6 +71,25 @@ This function is implemented using by pausing for .Fa microseconds of time or until any signal occurse. +.Sh RETURN VALUES +The +.Fn usleep +function returns 0 on successful completion. Otherwise, it returns -1 +and sets +.Va errno +to indicate the error. +.Sh ERRORS +The +.Fn usleep +function +will fail if: +.Bl -tag -width [EINVAL] +.It Bq Er EINTR +Some signal occurse. +.It Bq Er EINVAL +The +.Fa microseconds +argument specified 1000000 or more microseconds. .Sh NOTES .Pp A microsecond is 0.000001 seconds.