Re: short fread(), but no ferror/feof

2004-12-13 Thread Peter Astrand
On Mon, 13 Dec 2004, Jeff Johnston wrote: > > "fread() shall return the number of elements successfully read which is > > less than nitems only if a read error or end-of-file is encountered." > > > > Where in the POSIX standard did you find that above line? I could not locate > it > in mine. Th

Re: short fread(), but no ferror/feof

2004-12-11 Thread Peter Astrand
Dave Korn wrote: > The fix and the problem Peter is seeing are orthogonal. > > The fix referred to above fixes this problem: > >http://sources.redhat.com/ml/newlib/2004/msg00478.html >"Hence, one can see that fread() in unbuffered mode always returns the >specified count instead of the number o

Re: short fread(), but no ferror/feof

2004-12-10 Thread Peter Astrand
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 p

Re: short fread(), but no ferror/feof

2004-12-09 Thread Peter Astrand
>> 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 Lin