title: Portable way to pass file descriptor between different processes
body: <p>On most UNIX systems passing an open file between processes can be easily done for child/parent processes by fork(); however I need to share a fd "after" the child was already forked.</p>
  
  <p>I've found some <a href="http://www.regatta.cs.msu.su/doc/usr/share/man/info/ru_RU/a_doc_lib/aixprggd/progcomc/skt_comms.htm" rel="noreferrer">webpages</a> telling me that sendmsg() may work for arbitary processes; but that seems very OS dependent and complex. The <a href="http://lists.canonical.org/pipermail/kragen-hacks/2002-January/000292.html" rel="noreferrer">portlisten</a> seems like the best example I can find, but I'd prefer a good wrapper library like libevent that hides all the magic of kqueue, pool, ....</p>
  
  <p>Does anyone know if there's some library (and portable way) to do this?</p>