[ANNOUNCEMENT] Updated: Cygwin 1.7.15
Tue May 15 17:02:00 GMT 2012
> - Add CYGWIN=pipe_byte option to force opening of pipes in byte mode
> rather than message mode.
I can confirm that setting this fixes the test cases I was having problems with. Thanks! :)
A suggestion: maybe modify the documentation to state why one would set this? Current documentation has no clues for why this new pipe_byte option exists, and what problems it might solve. For example, on http://cygwin.com/cygwin-ug-net/using-cygwinenv.html maybe adding something like:
"By default, Cygwin uses message mode pipes, which more closely emulates UNIX pipe behavior. Byte mode is required when redirecting standard input for non-Cygwin programs that are not compatible with message mode pipes. For example, Visual C++ runtime libraries and the .NET Framework are not compatible with message mode pipes."
Maybe add something in the FAQ too, although I'm not sure if this is a frequently asked question yet that is worthy of addition! I would imagine it could be, given that other people use non-Cygwin programs from Cygwin and probably most of these are affected due to usage of Microsoft runtimes. I know the FAQ is one of the places I look when troubleshooting. I don't know if this is worthy to go in there, but perhaps an entry might look like:
"Q: Why do some programs fail to fully process redirected standard input?
A: By default, Cygwin uses message mode pipes when redirecting standard file handles, because this more closely emulates UNIX pipes. Non-Cygwin programs sometimes use runtimes that are not compatible with message mode pipes, so they break under some conditions. Example runtimes that break include Visual C++ runtime libraries and the .NET Framework. To work around this issue, set the CYGWIN environment variable option 'pipe_byte'.
An example of a condition that breaks these runtimes is a null write. For example, if a write of zero bytes is written to a message mode pipe, the receiving program will read zero bytes. Many runtimes incorrectly assume this is end-of-file, and they no longer correctly read standard input as a result. Byte mode pipes do not pass through these zero byte writes."
The one thing missing from all this discussion is why you'd want message mode pipes, other than that it more closely emulates UNIX. For example, are there some packages that break when presented with byte mode pipes? It could be useful to add some examples of negative real-world consequences to using byte mode pipes.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin