Pipes and children

Brian Ford ford@vss.fsi.com
Wed Apr 21 19:00:00 GMT 2004


I'm trying to digest and apply the wisdom of the following to Cygwin:

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q190/3/51.asp&NoWebContent=1

as I believe it will fix:

http://www.cygwin.com/ml/cygwin/2004-04/msg00802.html

Within the sample code presented, there are several comments about
preventing unclosable handle problems like:

// Create new output read handle and the input write handles. Set
// the Properties to FALSE. Otherwise, the child inherits the
// properties and, as a result, non-closeable handles to the pipes
// are created.

// Close inheritable copies of the handles you do not want to be
// inherited.

// Close pipe handles (do not continue to modify the parent).
// You need to make sure that no handles to the write end of the
// output pipe are maintained in this process or else the pipe will
// not close when the child process exits and the ReadFile will hang.

etc.  As such, I believe it may also be the *real* fix for:

http://www.cygwin.com/ml/cygwin/2003-10/msg01166.html

This is just FYI in case someone wants to help.  I'm in way over my
head because of my limited Cygwin, C++, and w32api knowledge.  I'll keep
digging; however marginally productive that is ;-).

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax:   314-551-8444



More information about the Cygwin-developers mailing list