title: sigaction: incorrect member name
body: <p>I'm in the process of transitioning my program's signal handling from signal() to sigaction().</p>
  
  <p>According to the <a href="http://pubs.opengroup.org/onlinepubs/7908799/xsh/sigaction.html" rel="nofollow noreferrer">UNIX spec</a> a <code>struct sigaction</code> should have at least 4 members; <code>sa_handler</code>, <code>sa_mask</code>, <code>sa_flags</code> and <code>sa_sigaction</code>.</p>
  
  <p>When I define a structure as follows, everything appears to be normal.</p>
  
  <pre><code>...
  #include &lt;signal.h&gt;
  ...
  struct sigaction sa;
  </code></pre>
  
  <p>But when I attempt to assign a value to <code>sa_handler</code>, the member does not exist.  Instead I see this:
  <img src="https://i.stack.imgur.com/fz7Aq.png" alt="Image: shows __sigaction_handler : {sigaction.h:1092} instead of sa_handler"></p>
  
  <p>I looked through my <code>signal.h</code> and <code>bits/sigaction.h</code> (neither of which has 1092 lines in case you're wondering) and nothing seems amiss.</p>
  
  <p>I also tried using this member name as is, but the compiler complains with</p>
  
  <blockquote>
    <p>incomparable types when assigning to type 'union ' from
    type 'void (*)(int)'</p>
  </blockquote>
  
  <p>This makes me think there is something wrong with how my compiler/IDE is handling the structure's definition, but that is above my head on how to diagnose.</p>
  
  <p>Any help or suggestions would be appreciated.</p>
  
  <p>System info:</p>
  
  <ul>
  <li>Debian 8</li>
  <li>linux 3.16.0-4-amd64</li>
  <li>gcc 4.9.2 (Debian 4.9.2-10)</li>
  <li>eclipse-cdt 3.8.1</li>
  </ul>
  
  <h3>Update - 8/3/2016</h3>
  
  <p>Found these two threads <a href="https://stackoverflow.com/questions/8846047/compile-errors-using-signal-h-in-linux">here</a> and <a href="https://stackoverflow.com/questions/6491019/struct-sigaction-incomplete-error">here</a>, that suggested defining the preprocessor symbols <code>_POSIX_C_SOURCE</code> and <code>_XOPEN_SOURCE</code> respectively.  I defined each (one at a time) and both 'fixed' the incompatable type issue (I successfully assigned a value to sa.__sigaction_handler).  But they both also broke my software's ability to use type intptr_t (used for thread function management) and were removed for that reason.</p>
  
  <p>Doing this fixed the issue, however.  I can now assign a variable to sa.sa_handler without the compiler throwing an error.  The IDE still shows it as a non-existent member (same as image linked above) but that is a minor issue IMHO.</p>