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: [eCos] a question about ROMFS


> 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/


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