Possible Duplicate:
Is there a better way than parsing /proc/self/maps to figure out memory protection?
I have a pointer and I want to check if the referenced memory is readable, writeable and/or executable. How can I do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You will have to parse the file
/proc/self/mapswhich contains memory mappings of your process, and check which of the mappings lie within the value of your pointer (if any). The/proc/self/mapsfile contains the memory protection (read/write/execute).See this question for more info about the maps file.