title: Why do we need to define _GNU_SOURCE macro before using POLLRDHUP event flag in poll() function?
body: <p>I am using <code>poll()</code> function in my program, I read <a href="http://man7.org/linux/man-pages/man2/poll.2.html" rel="noreferrer">this link</a> that to use <code>POLLRDHUP</code> flag you have to define <code>_GNU_SOURCE</code> before all header file inclusion. I needed this flag so that polling the socket can tell me whether the client has hung up or not, so that I can terminate the corresponding thread.</p>
  
  <p>By the way I am writing a C program for an 'echo' server which can handle multiple clients concurrently, and I am using GCC 4.1.2 on OpenSuse Linux Enterprise Server 10.3 (x86_64).</p>