This is the mail archive of the
mailing list for the Cygwin project.
Re: short fread(), but no ferror/feof
On Fri, 10 Dec 2004, Peter Astrand wrote:
> >> I've discovered that fread(ptr, size, nitems, stream) sometimes returns a
> >> value less than "nitems", but does not set feof() nor ferror(). As I
> >A simple, compilable test case with results shown on both linux and
> >cygwin would prove your theory.
> Here you go; example follows. Test run on Linux:
> Got 66 bytes:
> /bin/ls: /somebogus: Filen eller katalogen finns inte
> |EOF has been reached.
> Test run on Cygwin:
> $ ./a.exe
> Got 9 bytes:
> /bin/ls: |
> As you can see, the result is partial, and there is no EOF nor error.
> I guess this is the problem described at
> http://sources.redhat.com/ml/newlib/2004/msg00477.html. Perhaps you can
> apply the suggested patch?
According to <http://sources.redhat.com/ml/newlib/2004/msg00478.html>, the
patch was checked in on Oct 26. Cygwin uses the latest version of newlib.
Cygwin 1.5.12-1 was released on Nov 10, so it should contain this patch.
You can verify this by downloading the Cygwin source package, and looking
|\ _,,,---,,_ email@example.com
ZZZzz /,`.-'`' -. ;-;;,_ firstname.lastname@example.org
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html