title: Is there anyway to pass arguments to a signal handler?
body: <p>I'm registering in the main an handler for the SIGTERM like this:</p>
  
  <pre><code>signal(SIGTERM, sigterm_handler);
  </code></pre>
  
  <p>And the handler is a simple:</p>
  
  <pre><code>void sigterm_handler()
  {    exit(1);    }
  </code></pre>
  
  <p>What if I need to pass to the handler a few arguments like a 2 pointers or anything else? How do I register the handler in the signal function? Or at least... is there anyway to achieve that?</p>
  
  <p>Notice: the process is killed by a third party process, not by itself. But before closing I need to manually free some structures and write them on files.</p>