title: setting up IPC between unrelated processes
body: <p>I would like to inject a shared library into a process (I'm using <code>ptrace()</code> to do that part) and then be able to get output from the shared library back into the debugger I'm writing using some form of IPC. My instinct is to use a pipe, but the only real requirements are:</p>
  
  <ul>
  <li>I don't want to store anything on the filesystem to facilitate the communication as it will only last as long as the debugger is running.</li>
  <li>I want a portable Unix solution (so Unix-standard syscalls would be ideal).</li>
  </ul>
  
  <p>The problem I'm running into is that as far as I can see, if I call <code>pipe()</code> in the debugger, there is no way to pass the "sending" end of the pipe to the target process, and vice versa with the receiving end. I could set up shared memory, but I think that would require creating a file somewhere so I could reference the memory segment from both processes. How do other debuggers capture output when they attach to a process after it has already begun running?</p>