On Mon, Jan 31, 2005 at 12:36:44PM +0200, Shachar Shemesh wrote:

> Now here's the strange bit. If I open the file as "O_RDWR|O_CREAT, this 
> scheme works. The man page for mmap says that the prot argument "must 
> not conflict with the open  mode  of  the file", but surely there is no 
> conflict between "O_WRONLY" and "PROT_WRITE".
> 
> Or is there?

do_mmap_pgoff():
        case MAP_PRIVATE:
                if (!(file->f_mode & FMODE_READ))
                    return -EACCES;

Are you trying to map it MAP_PRIVATE? what is errno?

Thinking about it logically, it makes sense to fail the mapping if you
don't have O_READ on the file, because with mmap we have no easy way
of making sure you only write to the pointer you get back, and not
read from it...

Cheers, 
Muli
-- 
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/

Attachment: signature.asc
Description: Digital signature

Reply via email to