Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c

linux

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.

like image 648
user1636717 Avatar asked Mar 10 '26 01:03

user1636717


1 Answers

/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)


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!