title: Child reversing output when prematurely killed by parent
body: <p>This is some pseudo code of what I'm trying to achieve:</p>
  
  <p>fork</p>
  
  <p>in the child, dup2 a output descriptor to a file then exec a different program</p>
  
  <p>in parent, kill the child after a period of time</p>
  
  <p>The problem is though that after I kill the child the output file is empty even though the child has written to it at some stage. What am I doing wrong? I don't want to wait for the child but I also don't want it to reverse what it's already written to file.</p>