Reputation: 33
How do I programmatically generate something like /proc/pid/maps ? Is there an API which can get me the same data as in /proc/pid/maps ? Parsing text can be a bit flaky.
Upvotes: 3
Views: 1154
Reputation:
/proc/$pid/maps
is the API. If you're using C, you can reliably parse lines in this file using the scanf
format:
"%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n"
(source)
Upvotes: 7