3 ms·
> the only way to is shell out and scrape the output of ps Why couldn't you just read /proc/self/status and /proc/self/smaps in process? Would be like an order
by anarazel 9y ago
> the only way to is shell out and scrape the output of ps
Why couldn't you just read /proc/self/status and /proc/self/smaps in process? Would be like an order of magnitude less expensive.
- wdewind 9y agoBecause I have a shitty knowledge of Unix :) Best way to get the right answer on the internet is to post the wrong one.
- marios 9y agoFor what it's worth, the /proc filesystem is not on all UNIX /UNIX-like OSes. I believe it originated in Linux, and FreeBSD has a procfs interface as well, although it does not have all the bells and whistles you will find in Linux. OpenBSD on the other hand, does not have procfs at all.