[PATCH draft 0/6] Remove the fhandler_base_overlapped class

Ken Brown kbrown@cornell.edu
Sun May 26 15:10:00 GMT 2019

fhandler_pipe is currently the only class derived from
fhandler_base_overlapped.  This patch series rewrites parts of
fhandler_pipe so that it can be derived from fhandler_base instead.
We can then simplify the code by removing fhandler_base_overlapped.

In particular, this gets rid of the peculiar situation in which a
non-blocking write can return with I/O pending, leading to the
ugliness in fhandler_base_overlapped::close.

I've marked these patches as drafts because I've undoubtedly
overlooked some things.  Also, I haven't systematically done any
regression tests.  I have, however, run all the sample pipe programs
in Kerrisk's book "The Linux Programming Interface: Linux and UNIX
System Programming Handbook".  I've also run emacs-X11, gdb, git,
make, etc., so far without problems.

Ken Brown (6):
  Cygwin: fhandler_pipe: derive from fhandler_base
  Cygwin: fhandler_pipe: add raw_read and raw_write
  Cygwin: fhandler_pipe: set the blocking mode of the Windows pipe
  Cygwin: fhandler_pipe: fix permission problem
  Cygwin: remove the fhandler_base_overlapped class
  Cygwin: add fhandler_base::npfs_handle

 winsup/cygwin/fhandler.cc             | 395 ++------------------------
 winsup/cygwin/fhandler.h              |  90 +-----
 winsup/cygwin/fhandler_fifo.cc        |  30 --
 winsup/cygwin/fhandler_pipe.cc        | 354 ++++++++++++++++++++++-
 winsup/cygwin/fhandler_socket_unix.cc |  30 --
 winsup/cygwin/syscalls.cc             |   1 -
 6 files changed, 380 insertions(+), 520 deletions(-)


More information about the Cygwin-patches mailing list