I am trying to determine when a particular process starts based on its arguments in Mac OS X. There may be several processes running under the same name, but only one will have the arguments I'm looking for. Processes do not belong to the same user who will run my code. They will not modify their argv in any way.
The ps command displays exactly the information I need. But I would really like to avoid the appearance of "ps" and analyze its output.
I initially tried to solve from this issue using sysctl, but it turns out that it works only for your processes; see my other question for more information.
So how does ps get argv information for processes owned by other users?
source
share