X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0	tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <20100913041226.GA18909@ednor.casa.cgf.cx>
References: <000801cb2383$9c3ad3a0$d4b07ae0$@gmail.com>	<20100714184922.GA13548@ednor.casa.cgf.cx>	<001001cb23a5$3a879090$af96b1b0$@gmail.com>	<AANLkTimpz7mghcPDk=tt7xCXkrgruoGf6+bCReM3KziG@mail.gmail.com>	<20100912224108.GA18097@ednor.casa.cgf.cx>	<4C8D5A50.2020900@gmail.com>	<20100913041226.GA18909@ednor.casa.cgf.cx>
Date: Mon, 13 Sep 2010 07:11:06 +0100
Message-ID: <AANLkTinP+VLMTHWnWaEGY0w5s_fsgL4egzmi-5vqXLZ3@mail.gmail.com>
Subject: Re: {lp,cb}Reserved2 under Windows 7 and file descriptors
From: Andy Koppe <andy.koppe@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 13 September 2010 05:12, Christopher Faylor wrote:
> On Sun, Sep 12, 2010 at 03:55:12PM -0700, Daniel Colascione wrote:
>>On 9/12/10 3:41 PM, Christopher Faylor wrote:
>>> So this wasn't just an idea which went unimplemented waiting for tuits.
>>> It went unimplemented because I thought it was a bad idea.
>>
>>It is a lie, but it's also a distinction without a difference. =C2=A0What
>>kind of misbehavior could we expect to be caused by lying to a program
>>this way? Most programs that care to use console-specific functionality
>>will test for a console by using GetFileType() or just get the console
>>by opening "CONIN$". It would be very unusual to make decisions about
>>win32-level functionality based on a call to the C runtime file
>>descriptor library.
>
> No. =C2=A0It wouldn't.
>
>>Furthermore, in the rare instance that a program *does* misbehave, by
>>simply running "cat | program", we restore the old behavior.
>>
>>The one case I can see that might be a problem is the
>>"Console and Port I/O" family of functions, at
>>http://msdn.microsoft.com/en-us/library/7x2hy4cx.aspx.
>
> Those are what I was thinking of actually.

Guarding the use of console-specific functions with isatty() is wrong,
because isatty() is true not only for consoles but also for printers
and serial ports, apparently. Not that that would stop anyone ...

(Btw, the _isatty() documentation actually mentions "terminal" as a
character device alongside "console". What could they mean by that?)


> I'm not going to keep looping on this argument, making the same points
> over and over. =C2=A0I'm not willing to add this particular functionality=
 to
> Cygwin.

Fair enough. Would a standalone utility implementing this hack be
welcome though?

Andy

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

