title: AF_UNIX socket: can I pass socket handle between processes?
body: <p>Let's say I create a <code>socketpair()</code> and I pass the <em>handle</em> of one of the socket to a spawned process (<code>popen</code>), will the said process be able to communicate back with the parent?</p>
  
  <p>The examples I saw are applied using <code>fork()</code> which is out of scope for my current project.</p>
  
  <p><strong>Updated:</strong> I tried a simple test: </p>
  
  <ol>
  <li><p>Client: <code>socketpair</code> with sockets[0]</p></li>
  <li><p>From Client use <code>posix_spawn</code> with sockets<a href="http://people.cis.ksu.edu/~singh/CIS725/Fall99/programs/sock_ipc_tut.html" rel="nofollow noreferrer">1</a> as command-line argument</p></li>
  <li><p>Client: <code>write</code> to socket ... Client exits without any warning...</p></li>
  </ol>
  
  <p>It would appear that there is a problem with this method.</p>
  
  <p><strong>UPDATED:</strong>  I also found this <a href="http://people.cis.ksu.edu/~singh/CIS725/Fall99/programs/sock_ipc_tut.html" rel="nofollow noreferrer">note</a>:</p>
  
  <p><code>Pipes and socketpairs are limited to communication between processes with a common ancestor.</code></p>