This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: [eCos] a question about ROMFS
- To: jjtsai <jjtsai at itri dot org dot tw>
- Subject: Re: [ECOS] [eCos] a question about ROMFS
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Mon, 16 Jul 2001 22:01:13 +0100
- Cc: ecos-discuss at sources dot redhat dot com
- Organization: Red Hat UK Ltd.
- References: <005701c10dcb$d2cc2180$8c78608c@ccl.itri.org.tw>
> jjtsai wrote:
>
> Hi,
> I have a question about ROM files system.
>
> [Question Description]
> A fseek(,,SEEK_CUR) after fread() will cause inconsistency between
> "(CYG_StdioStream) real_stream.position"
> and "fp->f_offset". See also stream.inl and rom_fs.c.
I believe I understand the problem: the position required by lseek differs
from the stream position, potentially by the number of bytes in the buffer.
In that case your patch is not quite complete to address this problem: what
if you are moving forward 1 byte, ie. fseek(,1, SEEK_CUR), *but* the data
is already in the buffer. For a true stream rather than a file, we should
not flush the input buffer.
I'll see if I can work on a better patch.
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/