This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: romfs on linux / use of fread
- To: rob dot wj dot jansen at philips dot com
- Subject: Re: [ECOS] romfs on linux / use of fread
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Thu, 14 Jun 2001 18:14:48 +0100
- Cc: ecos-discuss at sources dot redhat dot com
- Organization: Red Hat UK Ltd.
- References: <0056890032314158000002L982*@MHS>
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/