Anders Johansson wrote:
On Friday 18 September 2009 09:39:16 Per Jessen wrote:
Does anyone know how to do this?
One way would be to use mmap(2) to allocate it, with only PROT_READ as the flag
Seems to me though that unless you are mapping a file from disk, or some other volatile memory from an external source, you will want to write to it at least once though, so you should probably allocate it with PROT_READ | PROT_WRITE, and after putting whatever data you want in there, change the permission flag with mprotect(2)
You're right, I would want to write-protect it later. Thanks for the hint. /Per Jessen, Zürich -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org