This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: {lp,cb}Reserved2 under Windows 7 and file descriptors


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. ÂWhat
>>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. ÂIt 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. ÂI'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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]