I have been using proc_info.h
and similar files to get information about my processes like paths, ppids, names, etc. Now I need to get the user's who own those processes using C/C++. How can I do this? in proc_info.h
I see the struct called proc_regioninfo
which has a member pri_user_tag
which might be what I am looking for but I'm cant figure out how to populate a struct of ````proc_regioninfo```. I've looked everywhere online and can't find an answer.
I've been digging around in this part of my file system trying to find stuff: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdks/MacOSX.sdk/usr/include
so maybe that will help you find things.
this question How to programatically get uid from pid in osx using c++? has an answer but I can't figure out how to install libproc-dev
like the person suggests, nor can my system figure out what to do with #include <proc/readproc.h>
.
If you have any idea I would greatly appreciate it!