lkml.org 
[lkml]   [1998]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Subjectmmap of readonly file (was Re: sendfile(2) idea)
Date
From

stefan@sime.com said:
> open("./page", O_RDONLY) = 3
> mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x400ad000

> I don't have a POSIX copy here; but PROT_WRITE on a O_RDONLY fd should
> IMHO fail...

Try again with MAP_SHARED instead of MAP_PRIVATE. Also, try writing to your
private mapped region and seeing what (if anything) happens to the file.
Do the same test with MAP_SHARED.
--
Steve Williams "The woods are lovely, dark and deep.
steve@icarus.com But I have promises to keep,
steve@picturel.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.057 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site