title: _GNU_SOURCE macro and epoll_wait behaviour
body: <p>I work on an app with several threads. One of them is used for epoll. This app also catches <code>SIGINT</code> signal and performs some finalization. Everything works ideally untill I set <code>_GNU_SOURCE</code> macros. This makes the program to stuck on the line:</p>
  
  <pre><code>int n = epoll_wait(epfd, events, N, -1);
  </code></pre>
  
  <p>So, setting <code>_GNU_SOURCE</code> prevents all (<code>recv</code> too) waiting calls from breaking on <code>SIGINT</code>. Why is it so? What is a workaround?</p>
  
  <p>In particular I want to use <code>sched_setaffinity</code>. This needs <code>CPU_SET</code> which is available only with <code>_GNU_SOURCE</code>.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>How I catch <code>SIGINT</code>:</p>
  
  <pre><code>static volatile int running = 1;
  static void int_handler(int i) {
        running = 0;
  }
  </code></pre>
  
  <p>then in <code>main</code>:</p>
  
  <pre><code>signal(SIGINT, int_handler);
  </code></pre>