This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: short fread(), but no ferror/feof
- From: Peter Astrand <astrand at lysator dot liu dot se>
- To: cygwin at cygwin dot com
- Cc: newlib at sources dot redhat dot com
- Date: Fri, 10 Dec 2004 11:18:12 +0100 (MET)
- Subject: Re: short fread(), but no ferror/feof
- References: <Pine.GSO.4.51L2.0412051701370.21199@koeberg.lysator.liu.se><Pine.GSO.4.51L2.0412092344001.4112@koeberg.lysator.liu.se><Pine.GSO.4.61.0412091946260.19749@slinky.cs.nyu.edu>
On Thu, 9 Dec 2004, Igor Pechtchanski 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:
> 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
> at newlib/libc/stdio/fread.c.
I've tested http://sources.redhat.com/ml/newlib/2004/txt00003.txt on
Cygwin, and it works. So, most probably, Cygwin uses the "fixed" newlib.
However, since my example code
(http://cygwin.com/ml/cygwin/2004-12/msg00305.html) still fails, something
is still wrong. Is it possible the the "fix" above actually caused this
problem?
/Peter Åstrand <astrand@lysator.liu.se>