mohan
mohan

Reputation: 1530

Getting memory permission details in Linux

I am using mmap for allocation memory and mark some pages as PROT_READ and few as PROT_NONE using mprotect. my implementation has logic based on the memory permission. Currently I have the memory location info, how do I get its current protection state? (PROT_READ/PROT_NONE)

Upvotes: 3

Views: 3948

Answers (1)

Kristof Provost
Kristof Provost

Reputation: 26322

I don't know if there's a syscall to retrieve this information. Absolute worst case you could parse /proc/<pid>/maps.

Upvotes: 4

Related Questions