ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

__p_sig_fn_t signal ( int  sig,
__p_sig_fn_t  func 
)

Definition at line 23 of file signal.c.

{
   __p_sig_fn_t temp;
   unsigned int i;

   switch (sig)
   {
      case SIGINT:
      case SIGILL:
      case SIGFPE:
      case SIGSEGV:
      case SIGTERM:
      case SIGBREAK:
      case SIGABRT:
         break;

      default:
         _set_errno(EINVAL);
         return SIG_ERR;
   }

   // check with IsBadCodePtr
   if ( (uintptr_t)func < 4096 && func != SIG_DFL && func != SIG_IGN)
   {
      _set_errno(EINVAL);
      return SIG_ERR;
   }

   for(i=0; i < sizeof(signal_list)/sizeof(signal_list[0]); i++)
   {
      if ( signal_list[i].signal == sig )
      {
         temp = signal_list[i].handler;
         signal_list[i].handler = func;
         return temp;
      }
   }

   /* should be impossible to get here */
   _set_errno(EINVAL);
   return SIG_ERR;
}

Generated on Sun May 27 2012 06:05:16 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.