delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/01/18/17:19:57

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=BAYES_00,KAM_MX,SPF_PASS
X-Spam-Check-By: sourceware.org
Date: Sun, 18 Jan 2009 23:19:40 +0100
From: Ed Schouten <ed AT 80386 DOT nl>
To: Sjors Gielen <mailinglist AT dazjorz DOT com>
Cc: "Yaakov (Cygwin/X)" <yselkowitz AT users DOT sourceforge DOT net>,
dave DOT korn DOT cygwin AT googlemail DOT com, cygwin AT cygwin DOT com
Subject: Re: GNU coreutils does not work on Cygwin because of freopen() ?
Message-ID: <20090118221940.GZ1247@hoeg.nl>
References: <49738867 DOT 702 AT dazjorz DOT com> <49739D07 DOT 7020507 AT cygwin DOT com> <49739E38 DOT 5080305 AT dazjorz DOT com> <4973A2B1 DOT 9060601 AT users DOT sourceforge DOT net> <4973A927 DOT 1010003 AT dazjorz DOT com>
MIME-Version: 1.0
In-Reply-To: <4973A927.1010003@dazjorz.com>
User-Agent: Mutt/1.5.18 (2008-05-17)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--6JAe/4X0qssghT2u
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello all,

* Sjors Gielen <mailinglist AT dazjorz DOT com> wrote:
> Yaakov (Cygwin/X) wrote:
>> Sjors Gielen wrote:
>>> Did you try with Cygwin coreutils or GNU coreutils? :)
>>
>> Cygwin's coreutils *is* GNU coreutils, with some patches which you will
>> find necessary.
>>
> [snip]
> Dave Korn wrote:
> >   However, you may have to recreate all the cygwin-specific patches
> > that the
> > cygwin bash maintainer hasn't managed to send upstream yet...
> [snip]
> > ?? Are you using an old version??  It should be fixed by now.
> >
> > http://www.mail-archive.com/bug-coreutils AT gnu DOT org/msg10188.html
>
> Oooh. Can I get a list of patches the Cygwin project has already applied=
=20=20
> to packages? :)
> So this bug was fixed in Cygwin's version of GNU coreutils, but not in=20=
=20
> Debian's version of GNU coreutils. Has a patch for that been sent=20=20
> upstream? I took GNU coreutils from Debian sid, which should be almost=20=
=20
> as up to date as it gets...

But that's not a proper fix anyway. cat can't just decide to reopen the
file descriptor of the standard output. That even breaks the first
sentence of POSIX:

	The cat utility shall read files in sequence and shall write
	their contents to the standard output in the same sequence.

If it says "the standard output" doesn't mean you can reopen the output
descriptor. This means you end up with two different file descriptors.
They can point to the same file, but they are not the same file
descriptor.

They fixed it by using SET_BINARY(), but not on Cygwin, because I assume
SET_BINARY() is a Windows-thing, not Cygwin.

I can't really understand why Cygwin just doesn't force O_BINARY to be
set. File descriptors on UNIX are supposed to display raw file contents.
There shouldn't be any (newline) processing. It makes no sense to
cripple Cygwin only because Notepad doesn't support newlines without the
carriage return.

--=20
 Ed Schouten <ed AT 80386 DOT nl>
 WWW: http://80386.nl/

--6JAe/4X0qssghT2u
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAklzqvwACgkQ52SDGA2eCwWayACeL6pNXsMlqm/V59xG8/tfRHsq
v9cAn2b/+4p3CxaIpR8wQo7b+zhKh6Ve
=qhNa
-----END PGP SIGNATURE-----

--6JAe/4X0qssghT2u--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019