How to get the Unix pid of the process behind a port

I use a port to communicate with an external process for a long running simulation. This works great, except I have no way of knowing the Unix pid of the process unless I poke the system. Sometimes I do need the pid for reporting purpose or simply to kill it. I have looked at:
Which use an external binary wrapper for signaling. IS there any simpler way if I only need to know the pid?

There is which gives you the os_pid.

1 Like