Hi,

I can't create a memory mapped file, using mmap, on a nand mapped as mtd device.

The command return invalid argument, with correct arguments, a code example is attached.

There is a patch [1] to add support memory mapped files on mtd devices and it's applied to linux-davinci, but don't appear to work.

Can someone verify if have the same behavior ?

Thanks.

Best Regards,
Aníbal

[1] - http://patchwork.ozlabs.org/patch/55616/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
#include <fcntl.h>

int main() {

	int memFd = -1;
	unsigned char * memMap = NULL;
	
	if((memFd = open("file..map", O_RDWR | O_SYNC)) < 0 ) {
		perror("file.map");	
		return 0;
	}

	memMap = mmap(0, getpagesize(), 
		PROT_WRITE | PROT_READ, MAP_SHARED, memFd,0);

	if(memMap == MAP_FAILED) {
		perror("mmap");
		return 0;
	}

	munmap(0, getpagesize());
	close(memFd);

	return 1;
}

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to