public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Cygwin passes through null writes to other software when redirecting standard input/output (i.e. piping)
Date: Sat, 28 Apr 2012 05:27:00 -0000	[thread overview]
Message-ID: <20120428052727.GA23749@ednor.casa.cgf.cx> (raw)
In-Reply-To: <4F9B38FB.9030607@dancol.org>

On Fri, Apr 27, 2012 at 05:25:31PM -0700, Daniel Colascione wrote:
>IIRC, it had something to do with preserving message boundaries at the
>TTY later. Again IIRC (and I only faintly recall this part) the PTY
>layer has to deliver one line at a time to readers. If a client calls
>read(2) with a giant buffer, he's still supposed to get back only a
>single line at a time. A message-mode pipe seems like a good way to
>provide these semantics because it preserves write boundaries --- so if
>you write only a line at a time, the reader reads only a line at a time.
>It's a shame that this approach causes problems.
>
>Why can't only pseudoterminal pipes be created as PIPE_TYPE_MESSAGE?
>Cygwin already has special logic to tell whether a handle it's opening
>is a pty and to treat it specially in that case.

Use the source code, Jake.  From pipe.cc:

 Note that the write side of the pipe is opened as PIPE_TYPE_MESSAGE.
 This *seems* to more closely mimic Linux pipe behavior and is
 definitely required for pty handling since fhandler_pty_master
 writes to the pipe in chunks, terminated by newline when CANON mode
 is specified.  

The above comment shows an "and" relationship here.  Message type pipes
more closely mimic Linux (UNIX) pipe behavior AND are definitely
required for ptys.

--
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

  reply	other threads:[~2012-04-28  5:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26 21:19 James Johnston
2012-04-27  0:17 ` Christopher Faylor
2012-04-27 14:26   ` James Johnston
2012-04-27 16:28     ` Christopher Faylor
2012-04-27 15:12   ` jojelino
2012-04-27 16:28     ` Christopher Faylor
2012-04-27  9:09 ` cygwin
2012-04-27 14:41   ` Christopher Faylor
2012-04-27 14:38 ` Corinna Vinschen
2012-04-27 22:38   ` James Johnston
2012-04-28  0:25     ` Daniel Colascione
2012-04-28  5:27       ` Christopher Faylor [this message]
2012-04-28 11:20         ` Daniel Colascione
2012-05-09 19:00           ` Linda Walsh
2012-05-09 19:21             ` James Johnston
2012-05-09 20:12               ` Christopher Faylor
2012-05-10 16:28                 ` James Johnston
2012-05-10 16:33                   ` Otto Meta
2012-05-10 17:57                   ` Earnie Boyd
2012-05-10 18:39                     ` Corinna Vinschen
2012-05-11  9:05                       ` Andrey Repin
2012-05-11  3:34                 ` Daniel Colascione
2012-05-11  5:08               ` Linda Walsh

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=20120428052727.GA23749@ednor.casa.cgf.cx \
    --to=cgf-use-the-mailinglist-please@cygwin.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).