summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-12-11 17:29:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-12-11 17:29:47 +0000
commitca688eee5b7362c24114bdfa7c8c74e0c200d3e6 (patch)
tree7c4ebea12d85940ec96cd52bf8089baf41bd85a7 /lib/libc
parent4eb3550abeee7fdb7e8cbc13a0d36048756cdf3a (diff)
clarify how timeout behaves
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/sys/select.219
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/libc/sys/select.2 b/lib/libc/sys/select.2
index 7826bd2b2a8..5e3c9abc62f 100644
--- a/lib/libc/sys/select.2
+++ b/lib/libc/sys/select.2
@@ -109,6 +109,12 @@ selection to complete. If
is a nil pointer, the select blocks indefinitely. To effect a poll, the
.Fa timeout
argument should be non-nil, pointing to a zero-valued timeval structure.
+.Fa Timeout
+is not changed by
+.Fn select ,
+and may be reused on subsequent calls, however it is good style to re-initialize
+it before each invocation of
+.Fn select .
.Pp
Any of
.Fa readfds ,
@@ -171,13 +177,14 @@ before the inclusion of
.Aq Pa sys/types.h .
.Pp
.Fn Select
-should probably return the time remaining from the original timeout,
-if any, by modifying the time value in place.
-This may be implemented in future versions of the system.
-Thus, it is unwise to assume that the timeout value will be unmodified
-by the
+should probably have been designed to return the time remaining from the
+original timeout, if any, by modifying the time value in place.
+However, it is unlikely this semantic will ever be implemented, as the
+change would cause source code compatibility problems.
+In general it is unwise to assume that the timeout value will be
+unmodified by the
.Fn select
-call.
+call, and the caller should reinitialize it on each invocation.
.Sh HISTORY
The
.Fn select