3

I know I can read the file /proc/$PID/maps, but I was wondering if there is an API to get process memory mappings.

osgx
  • 90,338
  • 53
  • 357
  • 513
Wei Hu
  • 2,888
  • 2
  • 27
  • 28
  • 2
    look at http://stackoverflow.com/questions/269314/is-there-a-better-way-than-parsing-proc-self-maps-to-figure-out-memory-protectio - it is rather similar – osgx Nov 15 '10 at 21:38
  • 1
    For this problem I actually made a kernel module that would walk the processes vma in kernel space. Parsing even a simple /proc/*/maps takes about 70us... grrr. – Thomas M. DuBuisson Nov 15 '10 at 22:49

1 Answers1

1

There is no API in kernel to get this information in 1 syscall. The only universal way is to read and parse a /proc/self/maps file.

osgx
  • 90,338
  • 53
  • 357
  • 513