This crate allows to pass a file descriptor between two processes. It works on linux and OSX.
Take a look at the examples folder to start.
examples