This is the mail archive of the
mailing list for the Cygwin project.
Re: 1.5.5-1: problem with read() on Athlon MP in WinXP
- From: Brian Ford <ford at vss dot fsi dot com>
- To: Jeff Gilchrist <jsgilchrist at hotmail dot com>
- Cc: cygwin at cygwin dot com
- Date: Tue, 9 Dec 2003 14:55:58 -0600 (CST)
- Subject: Re: 1.5.5-1: problem with read() on Athlon MP in WinXP
- References: <BAY2-F93inmuoQLeGpC0001aaaa@hotmail.com>
Please don't include plain text email addresses in the body of messages.
It is food for spam harvesters. Thanks.
On Tue, 9 Dec 2003, Jeff Gilchrist wrote:
> Brian Ford wrote:
> >It sounds like you may have two problems here, but this may be the first
> Well don't I feel like a newbie. That was the problem. I was reading in
> binary data and forgot to add the O_BINARY flag to open(). As soon as I did
> that, it worked fine on my Athlon system.
> Not sure why it did work on the other two machines but I guess that was just
> a fluke. :) I posted the test.c as the minimal amount of code out of a
> larger program that I had written where I was having the problems. The same
> code that doesn't work under cygwin on my Athlon was running fine under
> Linux on the same Althlon and Solaris on a Sparc too so I never suspected
> something simple as leaving out a O_BINARY.
> Since my code did work fine under Linux and Solaris, is this an artifact of
> cygwin having the option to treat files in "DOS" or "Unix" format by
> default? Or is this an actual bug in how cygwin handles binary data if the
> "BINARY" flag isn't set? I converted my code to use fopen()/fread() instead
> and still had the same problem if I didn't speciy the "b" flag.
Cygwin doesn't know the difference between text and binary data. It uses
one of open(O_BINARY), CYGWIN=[no]binmode, and "mount -b" to determine how
to treat a file.
Check the output of mount on the systems with differing behavior. I'd bet
you selected a default mode of UNIX on the working systems and DOS on the
> Thanks, this solves my problem and your answer is much appreciated.
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html