title: compile errors using signal.h in Linux
body: <p>I'm writing a shell program that must handle signals. My relevant signal handling related code is as follows:</p>
  
  <pre><code>#include &lt;signal.h&gt;
  ...
  #include &lt;sys/types.h&gt;
  ...
  void installSigactions( int, struct sigaction* );
  
  void handler_function( int signal_id );
  ...
  /*define signal table*/
  struct sigaction signal_action;
  
  /*insert handler function*/
  signal_action.sa_handler = handler_function;
  
  /*init the flags field*/
   signal_action.sa_flags = 0;
  
  /*are no masked interrupts*/
  sigemptyset( &amp;signal_action.sa_mask );
  
  /*install the signal_actions*/
  sigaction( SIGINT, &amp;signal_action, NULL );
  </code></pre>
  
  <p>Compiling gives me the following warnings and errors:</p>
  
  <pre><code>gcc -Wall -ggdb -ansi -static -pedantic -o os1shell2 os1shell2.c
  os1shell2.c:35: warning: 'struct sigaction' declared inside parameter list
  os1shell2.c:35: warning: its scope is only this definition or declaration, 
  which is probably not what you want
  os1shell2.c: In function 'main':
  os1shell2.c:66: error: storage size of 'signal_action' isn't known
  os1shell2.c:75: warning: implicit declaration of function 'sigemptyset'
  os1shell2.c:78: warning: implicit declaration of function 'sigaction'
  </code></pre>
  
  <p>Can anyone tell me why I'm getting these warnings and errors?</p>