title: Wait for and/or kill process grandchildren produced by fork
body: <p>I <code>fork()</code> into process X and Y, afterwards Y <code>forks()</code> again into itself and process Z multiple times.</p>
  
  <p>Now process Y is some kind of "listener" and I would like X to be the deleter. The Z processes perform the actual actions. Z processes are grandchildren of X.</p>
  
  <p>With a FIFO and some signaling, X has produced a list of all pids of the Z processes. The problem now is that I would like to delete Z process zombies with X (going through the list of pids). </p>
  
  <p>I've tried it with <code>waitpid()</code>, but of course that doesn't work (it only does for direct children). But I've read about the possibility of making an extension yourself for this. But I really wouldn't know how to do it.</p>
  
  <p>I've thought of the deleter keeping another list with zombies (signal when exiting) but this is just the same as i did with saving the pids, I would like to do it differently.</p>
  
  <p>Does anybody have an idea of how to do this?</p>