Hi list,
Object: I'm trying to create a file using mmap.
Let's assume, for the sake of discussion, that the file needs to be 42 bytes long.
Method:
I'm opening a standard file with O_WRONLY|O_CREAT. I seek into the just created file 41 bytes, and write there one byte of random data. Then I try to mmap the file using PROT_WRITE. I get "permission denied".
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?
Shachar
-- Shachar Shemesh Lingnu Open Source Consulting ltd. http://www.lingnu.com/
================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
