mmap on jffs2

Jörn Engel joern at wohnheim.fh-wedel.de
Tue Apr 22 05:33:42 EDT 2003


On Sun, 20 April 2003 22:00:51 +0800, leeyang wrote:
> 
> I am using jffs2 on a ppc860 system(amd29lv160).
> Things seems ok,but when I am trying mmap.
> 
> I want to mmap a file in flash,so i can treat
> the file like some records.
> 
> I mean operation like
>  fd = open("/usr/dat/sot.dat",O_RDWR,FILEMODE);
>  
>  ptr1=mmap(NULL,filesize,PROT_READ|PROT_WRITE,
>    MAP_SHARED,fd,0);
> 
> fd returns 3 and it is ok,however ptr1 returns -1.
> I checked the errno it said invalid argument.
> 
> I have to say arguments "filesize" above is not
> aligment to any requirements,just the real file
> size?Does it matter?
> 
> The same procedure can done on common ext2
> so i wonder jffs2 implement all the features like
> ext2?

AFAIK (someone please correct me) jffs2 does not support mmap. I don't
remember any technical reason, so it seems as if noone cared enough to
implement it.

You can do the work yourself, pay someone to do it or wait and hope
that someone else does it. As always.

Jörn

-- 
It's just what we asked for, but not what we want!
-- anonymous



More information about the linux-mtd mailing list