Memory Page Protections

From: Scott Ehlert
Date: Sat Jul 09 2005 - 02:41:47 EST


I'm currently writing a kernel driver dealing with memory interaction
and I'm having an issue with memory protection. I'm trying to figure
out how I can determine the protection set on a page of memory. For
example, with the mprotect syscall I can specify a set of protection
flags in order to change whether a memory page is readable, writable,
and executable or not. I don't want to change the protection. I'd
really just like to query it and figure out what the current
protection is set to for a particular page of memory.

I'd basically be looking for something similar to VirtualQuery from
WinAPI which I believe could give me that sort of information. I'm
just having trouble finding something like that here in Linux. Is
there some system call that I have overlooked?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/