I'm trying to get the PID of the responsible process for an XPC process.
For example, Safari has a PID of 500, and is communicating with 3 instances of com.apple.WebKit.WebContent.xpc, with PIDs of 510, 520, and 530.
Activity Monitor.app seems to know that those 3 XPC processes are related to Safari. It claims the "Process Group" is "Safari Web Content".
But this has nothing to do with the real unix process group ID. The GPID is not Safari.app's. In fact, Safari.app isn't even the process parent - launchd is.
So the question is - how do I know the "responsible" PID (i.e. is it Safari or Mail) for a com.apple.WebKit.WebContent.xpc instance?