Example #1
0
ACE_Sig_Action::ACE_Sig_Action (const ACE_Sig_Set &signals,
                                ACE_SignalHandler sig_handler,
                                const ACE_Sig_Set &sig_mask,
                                int sig_flags)
{
  // ACE_TRACE ("ACE_Sig_Action::ACE_Sig_Action");
  this->sa_.sa_flags = sig_flags;

  // Structure assignment...
  this->sa_.sa_mask = sig_mask.sigset ();

#if !defined(ACE_HAS_TANDEM_SIGNALS)
  this->sa_.sa_handler = ACE_SignalHandlerV (sig_handler);
#else
  this->sa_.sa_handler = (void (*)()) ACE_SignalHandlerV (sig_handler);
#endif /* !ACE_HAS_TANDEM_SIGNALS */

#if (ACE_NSIG > 0)
  for (int s = 1; s < ACE_NSIG; s++)
    if ((signals.is_member (s)) == 1)
      ACE_OS::sigaction (s, &this->sa_, 0);
#else  /* ACE_NSIG <= 0  */
  ACE_UNUSED_ARG (signals);
#endif /* ACE_NSIG <= 0  */
}
Example #2
0
ACE_Sig_Action::ACE_Sig_Action (ACE_SignalHandler sig_handler,
                                const ACE_Sig_Set &sig_mask,
                                int sig_flags)
{
  // ACE_TRACE ("ACE_Sig_Action::ACE_Sig_Action");
  this->sa_.sa_flags = sig_flags;

  // Structure assignment...
  this->sa_.sa_mask = sig_mask.sigset ();

#if !defined(ACE_HAS_TANDEM_SIGNALS)
  this->sa_.sa_handler = ACE_SignalHandlerV (sig_handler);
#else
  this->sa_.sa_handler = (void (*)()) ACE_SignalHandlerV (sig_handler);
#endif /* !ACE_HAS_TANDEM_SIGNALS */
}