This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Observations on select.cc (19990922 snapshot)
- To: cygwin at sourceware dot cygnus dot com
- Subject: Observations on select.cc (19990922 snapshot)
- From: patl at cag dot lcs dot mit dot edu (Patrick J. LoPresti)
- Date: 24 Sep 1999 16:40:20 -0400
Just some observations from reading the code and playing with strace.
Pull up select.cc and follow along.
The peek_pipe() function frequently gets called on the input side of a
pipe. That causes the call to PeekNamedPipe() to fail with a
permission error (Win32 only lets you peek at the output side), which
is kind of annoying. Perhaps peek_pipe() could check read_selected
before doing the PeekNamedPipe?
Also, there currently seem to be only clunky attempts to enforce the
invariant that the bits set in the fd_sets when select() returns are
subsets of the bits which were passed in. (I'm not even certain this
is always true.) Wouldn't it make sense for the set_bits() function
to enforce this invariant by checking {read,write,except}_selected
before setting the corresponding bit? Then many of the read_selected
tests around the file could be removed.
By the way, I am not asking anyone else to do this work (unless they
want to). I just want to confirm with the developers that these are
reasonable things to do before I bother...
Thanks!
- Pat
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com