public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "James Johnston" <JamesJ@motionview3d.com>
To: <cygwin@cygwin.com>
Subject: RE: [ANNOUNCEMENT] Updated: Cygwin 1.7.15
Date: Tue, 15 May 2012 17:02:00 -0000	[thread overview]
Message-ID: <05e901cd32bc$78dc8210$6a958630$@motionview3d.com> (raw)
In-Reply-To: <announce.20120510062830.GB11695@calimero.vinschen.de>

> - 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
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

      parent reply	other threads:[~2012-05-15 17:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-10  6:34 Corinna Vinschen
2012-05-10  6:52 ` Thomas Wolff
2012-05-10 14:18   ` Christopher Faylor
2012-05-12 11:11 ` Enrico Forestieri
2012-05-12 17:46   ` Christopher Faylor
2012-05-12 17:51     ` Ryan Johnson
2012-05-12 18:30       ` Christopher Faylor
2012-05-12 19:17         ` Christopher Faylor
2012-05-12 22:23           ` Enrico Forestieri
2012-05-15 17:02 ` James Johnston [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='05e901cd32bc$78dc8210$6a958630$@motionview3d.com' \
    --to=jamesj@motionview3d.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).