title: Signal handler using sigaction and instruction SIGINT. fail with struct variable: no storage size of sa is known
body: <p>I'm a noob with C programming. I'm just trying to make a program that registers if the user taps three times CRTL+C in three seconds. My problem is that the terminal says always that: no storage size of 'sa' is known. I searched for many examples in the web but it appears always the same problem. Maybe it's a problem withe the include section so I post all my code.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;signal.h&gt;
  #include &lt;string.h&gt;
  #include &lt;time.h&gt;
  #include &lt;unistd.h&gt;
  #include  &lt;stdlib.h&gt;
  
  
  int counter=0;
  int counter2=0;
  //time timestart;
  //time timeend;
  void signalHandler(int signum);
  void  ALARMhandler(int sig);
  void SIGHUPhandler();
  void SIGUSR1handler();
  
  
  void signalHandler(int signum){ 
  alarm(3);
  //printf("the signal caught %d\n", signum);
  if (signum == SIGUSR1){
          printf("received SIGUSR1\n");
      signal(SIGUSR1, SIGUSR1handler);
      counter++;
      }else if (signum == SIGKILL){
          printf("received SIGKILL\n");
      counter++;
      }else if (signum == SIGSTOP){
          printf("received SIGSTOP\n");
      counter++;
  }else if(counter&gt;=3){
      printf("shut program");
  
  }else if (signum == SIGINT){// sorry sigint can't be handled
          printf("received SIGint\n");
      counter++;
  }else if(signum== SIGALRM ){
      printf("recived SIGALRM\n");
      signal(SIGALRM, ALARMhandler);
      counter++;
  }else if(signum== SIGHUP){
      printf("recived SIGHUP\n");
      signal(SIGHUP, SIGHUPhandler);
  }
  //exit(signum);
    }
  
  
    int main( void )
    {
  /* Place your handler somewhere around here */
  clock_t timeStart, timeEnd;
  printf( "Hello World!\n" );
  //for ( ;; )
  //{
      /* infinite loop */
  //}
  
  struct sigaction sa;
  memset (&amp;sa, 0, sizeof(sa));
  sa.sa_handler = signalHandler;
  //sigemptyset(&amp;sa.sa_mask);
  //sa.sa_flags = SA_RESTART;
  
  
  counter++;
  
  while(counter2&lt;3){
      printf("please press CRTL+C\n");
      timeStart=clock();
      //sigaction(SIGINT, &amp;sa, NULL);
      pause();
      timeEnd=clock();
      if (timeEnd - timeStart &lt; 3){
          counter++;
      }else if(timeEnd - timeStart ==3){
          printf("shutting down\n");
          exit(1);
      }//end esle if
  
  
      counter2++;
  
  }
  printf("shutting down\n");
  return 0;
  </code></pre>
  
  <p>}</p>
  
  <p>The problem seems to be in this declaration: <code>struct sigaction sa;</code> 
  The terminal says: <code>no storage size of 'sa' is known</code>.</p>
  
  <p>I know that the parameters of struct must be declared but I've seen many examples on the net that doesn't have this declaration. What I'm doing wrong? </p>