summaryrefslogtreecommitdiff
path: root/lib/libc/sys
diff options
context:
space:
mode:
authorfair <fair@NetBSD.org>2000-07-07 05:18:49 +0000
committerfair <fair@NetBSD.org>2000-07-07 05:18:49 +0000
commit1513bd135dd03751f60f5bc16017ced0a9b4e9cb (patch)
tree6e0c41bdf999608413c6a0f29e09728de433a00f /lib/libc/sys
parent4aa53dcd31f2d50214453a04353cd3fedab36c12 (diff)
Add a proper DESCRIPTION to the man page, per PR 10072.
Diffstat (limited to 'lib/libc/sys')
-rw-r--r--lib/libc/sys/nanosleep.230
1 files changed, 20 insertions, 10 deletions
diff --git a/lib/libc/sys/nanosleep.2 b/lib/libc/sys/nanosleep.2
index cf05b17d174..9be1a5f3590 100644
--- a/lib/libc/sys/nanosleep.2
+++ b/lib/libc/sys/nanosleep.2
@@ -1,4 +1,4 @@
-.\" $NetBSD: nanosleep.2,v 1.2 1999/12/02 21:42:38 kleink Exp $
+.\" $NetBSD: nanosleep.2,v 1.3 2000/07/07 05:18:49 fair Exp $
.\"
.\" Copyright (c) 1986, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -35,7 +35,7 @@
.\"
.Dd April 17, 1997
.Dt NANOSLEEP 2
-.Os
+.Os
.Sh NAME
.Nm nanosleep
.Sh LIBRARY
@@ -44,28 +44,38 @@
.Fd #include <time.h>
.Ft int
.Fn nanosleep "const struct timespec *rqtp" "struct timespec *rmtp"
-.\" .Sh DESCRIPTION
+.Sh DESCRIPTION
+The
+.Fn nanosleep
+suspends execution of the calling process until either the number of
+seconds and nanoseconds specified by
+.Fa rqtp
+have elapsed or a signal is delivered to the calling process and its
+action is to invoke a signal catching function or to terminate the
+process.
+The suspension time may be longer than requested due to the
+scheduling of other activity by the system.
.Sh RETURN VALUE
-If the
+If the
.Fn nanosleep
function returns because the requested time has elapsed, the value
-returned will be zero.
+returned will be zero.
.Pp
-If the
+If the
.Fn nanosleep
function returns due to the delivery of a signal, the value returned
will be the -1, and the global variable
.Va errno
will be set to indicate the interruption.
-If
+If
.Fa rmtp
-is
+is
.Pf non- Dv NULL ,
the timespec structure it references is updated to contain the
unslept amount (the request time minus the time actually slept).
.Sh ERRORS
If any of the following conditions occur, the
-.Nm
+.Nm
function shall return -1 and set
.Va errno
to the corresponding value.
@@ -73,7 +83,7 @@ to the corresponding value.
.It Bq Er EFAULT
Either
.Fa rqtp
-or
+or
.Fa rmtp
points to memory that is not a valid part of the process
address space.