public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug manual/17459] New: Manual doesn't mention that timeout argument of select can be modified
@ 2014-10-06 14:33 GavinSmith0123 at gmail dot com
2014-10-28 13:42 ` [Bug manual/17459] " mtk.manpages at gmail dot com
0 siblings, 1 reply; 2+ messages in thread
From: GavinSmith0123 at gmail dot com @ 2014-10-06 14:33 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=17459
Bug ID: 17459
Summary: Manual doesn't mention that timeout argument of select
can be modified
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: manual
Assignee: unassigned at sourceware dot org
Reporter: GavinSmith0123 at gmail dot com
CC: mtk.manpages at gmail dot com, roland at gnu dot org
In the "Waiting for I/O" node of the manual (which is in the manual/llio.texi
file), in the description of the "select" function, it is mentioned that you
can timeout waiting for input or output by passing a pointer to a struct
timeval object to "select". However, it doesn't say that select can overwrite
this object. This led to a problem when I tried to reuse the struct timeval
object in a loop with a select call.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug manual/17459] Manual doesn't mention that timeout argument of select can be modified
2014-10-06 14:33 [Bug manual/17459] New: Manual doesn't mention that timeout argument of select can be modified GavinSmith0123 at gmail dot com
@ 2014-10-28 13:42 ` mtk.manpages at gmail dot com
0 siblings, 0 replies; 2+ messages in thread
From: mtk.manpages at gmail dot com @ 2014-10-28 13:42 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=17459
--- Comment #1 from Michael Kerrisk <mtk.manpages at gmail dot com> ---
(In reply to Gavin Smith from comment #0)
> In the "Waiting for I/O" node of the manual (which is in the
> manual/llio.texi file), in the description of the "select" function, it is
> mentioned that you can timeout waiting for input or output by passing a
> pointer to a struct timeval object to "select". However, it doesn't say that
> select can overwrite this object. This led to a problem when I tried to
> reuse the struct timeval object in a loop with a select call.
Confirmed. POSIX permits this behavior. The select(2) man page documents this
point:
On Linux, select() modifies timeout to reflect the amount of
time not slept; most other implementations do not do this.
(POSIX.1-2001 permits either behavior.) This causes problems
both when Linux code which reads timeout is ported to other
operating systems, and when code is ported to Linux that reuses
a struct timeval for multiple select()s in a loop without
reinitializing it. Consider timeout to be undefined after
select() returns.
A fix to the glibc manual is probably in order.
Cheers,
Michael
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-28 13:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-06 14:33 [Bug manual/17459] New: Manual doesn't mention that timeout argument of select can be modified GavinSmith0123 at gmail dot com
2014-10-28 13:42 ` [Bug manual/17459] " mtk.manpages at gmail dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).