title: libuv how to ignore SIGPIPE when connection reset by peer (linux)
body: <p>I receive a <code>SIGPIPE</code> from <code>uv_write()</code> as connection is reset by the peer.</p>
  
  <pre><code>p/x stream-&gt;flags
  0x46064
  
  ./src/unix/internal.h:# define UV__POLLRDHUP 0x2000
  </code></pre>
  
  <p>For BSD to prevent <code>SIGPIPE</code> libuv has:</p>
  
  <pre><code>./src/unix/core.c
  
  #if defined(SO_NOSIGPIPE)
   {
      int on = 1;
      setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &amp;on, sizeof(on));
   }
  #endif
  </code></pre>
  
  <p>Linux does not have <code>SO_NOSIGPIPE</code> as an option. Any suggestions how to handle <code>SIGPIPE</code> signal for linux other than <code>signal(SIGPIPE, SIG_IGN);</code></p>