This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: JFFS2 lseek
- From: eibach at gdsys dot de
- To: ecos-discuss at ecos dot sourceware dot org
- Date: 25 Mar 2004 15:33:12 UT
- Subject: [ECOS] Re: JFFS2 lseek
Hello,
the same problem can be found in RAMFS.
Regards,
Dirk
-------- Original Message --------
Subject: JFFS2 lseek (23-Mrz-2004 11:31)
From: eibach@gdsys.de
To: ecos-discuss@ecos.sourceware.org
> Hello,
>
> The The Single UNIX Specification, Version 2 states the following about
> the lseek function:
>
> "The lseek() function will allow the file offset to be set beyond the end
> of the existing data in the file. If data is later written at this point,
> subsequent reads of data in the gap will return bytes with the value 0
> until data is actually written into the gap."
>
> The code in jffs2_fo_lseek contains the following:
>
> // Check that pos is still within current file size, or at the
> // very end.
> if (pos < 0 || pos > node->i_size)
> return EINVAL;
>
> So it seems lseek() does not allow to set the offset beyond the current end
> of file. Is that correct or am I getting something wrong?
> Any suggestions how this could be fixed?
>
> Regards,
> Dirk
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss