I use mprotect() to set protection flags to a memory area. Later on, I want to restore this memory area's protection flags.
My question is, how to get protection flags of a memory area? the flags inclue PROT_READ ...
My workaround is to parse /proc/self/maps manually. But this solution is to clumsy ...
I wonder if there's any system call that I can use.