delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/01/18/16:25:33

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <49739E38.5080305@dazjorz.com>
Date: Sun, 18 Jan 2009 22:25:12 +0100
From: Sjors Gielen <mailinglist AT dazjorz DOT com>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: GNU coreutils does not work on Cygwin because of freopen() ?
References: <49738867 DOT 702 AT dazjorz DOT com> <49739D07 DOT 7020507 AT cygwin DOT com>
In-Reply-To: <49739D07.7020507@cygwin.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

Larry Hall (Cygwin) wrote:
> dazjorz wrote:
>> Hey all,
>>
>> I'm not very great with the inner workings of GNU or Cygwin libc, so 
>> please bear with me if I make any mistakes or misunderstandings.
>>
>> I was trying to get GNU coreutils to work on Cygwin. Maybe this seems 
>> weird to you guys, because Cygwin has coreutils, but there are a few 
>> reasons:
>> - Cygwin didn't have md5sum, GNU coreutils did (and I need md5sum)
> 
> <http://cygwin.com/cgi-bin2/package-grep.cgi?grep=bin%2Fmd5sum>
> 
> Did you miss this?

Hmm. I guess. Oh well, I didn't have md5sum before, I think :/

>> - It should work, and "Because I Can" is always a valid reason in UNIX 
>> world
>> - I'm trying to bootstrap Debian on Cygwin, and coreutils from Debian 
>> is my first try; getting coreutils from Cygwin may be done later.
>>
>> However, I noticed there are some very weird bugs happening. See for 
>> example, this bug in cat (don't look at the title of the page, I 
>> blamed bash first)
>> http://paster.dazjorz.com/?p=3845
> 
> Your example works fine for me with the latest coreutils.  Perhaps you're
> working with a buggy locally built version?
> 

Did you try with Cygwin coreutils or GNU coreutils? :)

By the way, list, I've been looking for some other things. This problem 
is caused by:
- cat calling freopen to make the handle binary (shouldn't it be binary 
in the first place? shouldn't it check if it's already opened in binary 
mode?)
- freopen() not checking if O_APPEND is set, etc. (is it possible to 
check this?)

I'll write a test case for freopen(), that shows O_APPEND is being 
missed, causing this bug.

Sjors

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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