I'm trying to get the information on a PID via c
or terminal
(ideally I would like to get it both ways, multiple methods)
I have a PID and would like to figure out the time it was claimed. By claimed i mean when a program started using it. Or if a PID was reused, when the latest program that is using it, started to use it.
In Linux what I do is lstat "/proc/PID_HERE/exe"
or lstat "/proc/PID_HERE/cmdline"
but I cant figure out how to do this on Mac OS.
Note: I changed from stat
to lstat
because a single exe is being used with command line arguments to open multiple instances. So each instance gets a new pid, so I want info on that specific instance, thus on Linux I have to use lstat
. So any lstat
equivalent to get pid info on mac os?