public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Sjors Gielen <mailinglist@dazjorz.com>
To: cygwin@cygwin.com
Subject: Re: GNU coreutils does not work on Cygwin because of freopen() ?
Date: Sun, 18 Jan 2009 21:42:00 -0000	[thread overview]
Message-ID: <49739E38.5080305@dazjorz.com> (raw)
In-Reply-To: <49739D07.7020507@cygwin.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/

  reply	other threads:[~2009-01-18 21:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-18 21:25 dazjorz
2009-01-18 21:37 ` Larry Hall (Cygwin)
2009-01-18 21:42   ` Sjors Gielen [this message]
2009-01-18 22:19     ` Yaakov (Cygwin/X)
2009-01-18 22:22       ` Sjors Gielen
2009-01-18 22:26         ` Matt Wozniski
2009-01-18 22:29         ` Ed Schouten
2009-01-19  2:16           ` Eric Blake
2009-01-18 23:52         ` Eric Blake
  -- strict thread matches above, loose matches on Subject: below --
2009-01-18 21:21 dazjorz
2009-01-18 22:19 ` Dave Korn
2009-01-19  2:42   ` Eric Blake

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=49739E38.5080305@dazjorz.com \
    --to=mailinglist@dazjorz.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).