title: Preventing SIGPIPE
body: <p>Let's consider the following example. </p>
  
  <p>I have a parent process that creates a pipe, spawns a child and read the child's standard output using this pipe. At some point, the parent process is no longer interested in the child's output, and closes the read end of the pipe. </p>
  
  <p>Apparently, if the child keeps writing, will this result in the child process receiving a <code>SIGPIPE</code> signal.</p>
  
  <p>Question: is there a way to redirect the child's output to <code>/dev/null</code> so that it still keeps running and producing output, but the parent process can go on doing other things and call <code>waitpid</code> on the child later? Note that setting the child's <code>SIGPIPE</code> handler to <code>SIG_IGN</code> is not an option because I don't have control over the child's signal handlers.</p>