title: What is the meaning of sigfillset? Do I really needed it in my implementation?
body: <p>I have the following configuration:</p>
  
  <pre><code>static const signal_information signals_table [] =
  {
      // ignored signals.
  
      { SIGTSTP , true , SA_RESTART , NULL },
      { SIGQUIT , true , SA_RESTART , NULL },
      { SIGINT  , true , SA_RESTART , NULL },
      { SIGTTOU , true , SA_RESTART , NULL },
      { SIGTTIN , true , SA_RESTART , NULL },
      { SIGHUP  , true , SA_RESTART , NULL },
  
      // non-ignored signals.
  
      { SIGTERM , false , SA_RESTART , signal_term_handler },
      { SIGCHLD , false , SA_RESTART | SA_NOCLDSTOP , signal_child_handler }
  };
  </code></pre>
  
  <p>Based on this structure:</p>
  
  <pre><code>// signal information type definition.
  typedef struct
  {
      // the signal identifier.
      int signal;
  
      // flag indicating if the signal should be ignored.
      bool ignore;
  
      // signal action flags that will be used for the signal.
      int flags;
  
      // the handler of the signal.
      void (*handler) (void);
  } signal_information;
  </code></pre>
  
  <p>And the following function which gets the configuration and installs the appropriate signals:</p>
  
  <pre><code>const bool
  setup_signals_support (void)
  {
      struct sigaction signal_action;
  
      memset (&amp;signal_action, 0, sizeof (signal_action));
  
      if (sigfillset (&amp;signal_action.sa_mask) &lt; 0)
      {
          log_error (failed_to_initialize_signal_set_message);
          return false;
      }
  
      for (int i = 0; i &lt; (sizeof (signals_table) / sizeof (signals_table[0])); i++)
      {
          signal_action.sa_flags = signals_table[i].flags;
  
          signal_action.sa_handler = signals_table[i].ignore ? SIG_IGN : signal_dispatcher;
  
          if (sigaction (signals_table[i].signal, &amp;signal_action, NULL) &lt; 0)
          {
              log_error ("%s '%s'.", failed_to_change_signal_action_message, strsignal (signals_table[i].signal));
              return false;
          }
      }
  
      return true;
  }
  </code></pre>
  
  <p>Question 1:</p>
  
  <p>What I really want to know is if the following fraction of code from the function is really necessary:</p>
  
  <pre><code>if (sigfillset (&amp;signal_action.sa_mask) &lt; 0)
  {
      log_error (failed_to_initialize_signal_set_message);
      return false;
  }
  </code></pre>
  
  <p>Also, I cannot understand what is the meaning of sigfillset.</p>
  
  <p>Question 2:</p>
  
  <p>Can I reuse the same sigaction (signal_action) for all signals or I have to create a new one for each signal configuration record inside the function? What I really want to avoid is sharing common configuration while installing signals. Each signal configuration should not affect others. Can I reuse the sigaction in such way?</p>
  
  <p>Thanks.</p>