title: why my signal handler is not working using sigaction function?
body: <p>I was trying following signal handler program , referring from an online tutorial  , but it does not seems working , what is wrong with my code:</p>
  
  <pre><code>#include&lt;signal.h&gt;
  #include&lt;unistd.h&gt;
  #include&lt;string.h&gt;
  #include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  
  typedef void (*SignalHandlerPointer)(int);
  
  static void UsrHostSigAbort(int pSignal)
  {
          //stopService();
      printf("pankaj");
  }
  void HandleHostSignal()
  {
          struct sigaction satmp;
          memset(&amp;satmp, '\0' , sizeof(satmp));
          SignalHandlerPointer usrSigHandler;
          satmp.sa_flags &amp;= ~SA_SIGINFO;
          satmp.sa_handler = UsrHostSigAbort;
          usrSigHandler = sigaction (SIGINT , &amp;satmp, NULL);
  }
  
  void main()
  {
  HandleHostSignal();
  
  while(1)
  {
  sleep(1);
  }
  }
  </code></pre>
  
  <p>I am compiling and running this program in ubuntu.</p>