user1636717
user1636717

Reputation: 33

How do I programmatically generate something like /proc/pid/maps?

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

Answers (1)

user149341
user149341

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

Related Questions