title: Handle a kill signal
body: <p>I want to handle a <code>kill signal</code> from C program.
  I'm starting by create an infinite loop and handle the signal</p>
  
  <pre><code>void signal_callback_handler(int signum)
  {
     printf("Caught signal %d\n",signum);
     // Cleanup and close up stuff here
  
     // Terminate program
     exit(signum);
  }
   main()
  {
      signal(SIGINT, signal_callback_handler);
      printf("pid: %d \n",getpid());
      while(1)
      {
  
      }
  
  }
  </code></pre>
  
  <p>When I run this program and make CTRL+C, the kill is handled, and it works. The message <code>Caught signal</code> is printed.
  However, when I'm trying to kill from another program</p>
  
  <pre><code>int main(int argc, char **argv)
  {
      kill(atoi(argv[1]), SIGKILL);
  
      return 0;
  
  }
  </code></pre>
  
  <p>The program is stoped but the signal is not handled. In other words, the message <code>Caught signal</code> is not printed. The infinite loop is just stopped.</p>