Memory Page Protections
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?