summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2023-07-07 01:31:25 +0000
committerriastradh <riastradh@NetBSD.org>2023-07-07 01:31:25 +0000
commit136e07d5af886c7cfdb9099d4d597cfeab37ee5c (patch)
tree0008ca6a8fff3f934f4aade03ebead4a4e15fef8
parentd2e28e75c8d813f582a8bdbde3b94f1f51743b26 (diff)
select(2), poll(2): Clarify return values.
-rw-r--r--lib/libc/sys/poll.28
-rw-r--r--lib/libc/sys/select.26
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/libc/sys/poll.2 b/lib/libc/sys/poll.2
index 2ea7680136e..93c2b5aea65 100644
--- a/lib/libc/sys/poll.2
+++ b/lib/libc/sys/poll.2
@@ -1,4 +1,4 @@
-.\" $NetBSD: poll.2,v 1.37 2021/02/09 09:01:29 wiz Exp $
+.\" $NetBSD: poll.2,v 1.38 2023/07/07 01:31:25 riastradh Exp $
.\"
.\" Copyright (c) 1998, 2005, 2020 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -210,8 +210,10 @@ Sockets produce POLLIN rather than POLLHUP when the remote
end is closed.
.Sh RETURN VALUES
.Fn poll
-returns the number of descriptors that are ready for I/O, or \-1 if an
-error occurred.
+returns the number of descriptors that are ready for I/O, or returns
+\-1 and sets
+.Dv errno
+if an error occurred.
If the time limit expires,
.Fn poll
returns 0.
diff --git a/lib/libc/sys/select.2 b/lib/libc/sys/select.2
index 56812dcc8a2..6ae8826fcda 100644
--- a/lib/libc/sys/select.2
+++ b/lib/libc/sys/select.2
@@ -1,4 +1,4 @@
-.\" $NetBSD: select.2,v 1.43 2017/10/25 17:39:47 abhinav Exp $
+.\" $NetBSD: select.2,v 1.44 2023/07/07 01:31:25 riastradh Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -155,7 +155,9 @@ interface instead, which tends to be more portable and efficient.
.Fn select
returns the number of ready descriptors that are contained in
the descriptor sets,
-or \-1 if an error occurred.
+or returns \-1 and sets
+.Dv errno
+if an error occurred.
If the time limit expires,
.Fn select
returns 0.