This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: romfs on linux / use of fread


rob.wj.jansen@philips.com wrote:
> 
> All,
> 
> after having some problems with fread() on my private filesystem I decided to test this with the romfs package.
> 
> It seems that fread() works in CYGNUM_LIBC_STDIO_BUFSIZE and it will read a maximum of this number of
> bytes from a file at a time.
> 
> performing an fread(buff, 1, 4096, fp) (right after opening the file) tells me that 256 items have been read.
> Performing multiple fread(buff, 1, 250, fp) operations return 250, 6, 250, 6 etc. and looking at the implementation
> I found that indeed the function stops after reading all data from the current buffer.

I agree that this is actually a bug rather than a performance issue - the
standard says it should only read less than requested on error or EOF.
Since you offered to make a patch that would be the most convenient :-).
Ditto fwrite presumably?

You can have your name in lights if you also include a ChangeLog entry.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]