title: POLLHUP vs POLLNVAL, or what is POLLHUP?
body: <p>The manpages say for poll(2):</p>
  <blockquote>
  <p>POLLHUP - Hang up (output only)</p>
  <p>POLLNVAL - Invalid request: fd not open (output only)</p>
  </blockquote>
  <p>What exactly is the difference?  Writing a simple program shows that <code>POLLNVAL</code> will trigger if I close a file descriptor, then try reading from the closed fd.  However, I can't figure out a way to return a <code>POLLHUP</code>.</p>