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:
https://www.hex.pm/packages/porcelain
Which use an external binary wrapper for signaling. IS there any simpler way if I only need to know the pid?

There is Port.info/1 which gives you the os_pid.

1 Like