Example #1
0
static int
efab_signal_handler_type(int sig, __sighandler_t user_handler)
{
  if( user_handler == SIG_IGN )
    return OO_SIGHANGLER_IGN_BIT;
  else if( user_handler != SIG_DFL )
    return OO_SIGHANGLER_USER;
  else if( sig_kernel_stop(sig) )
    return OO_SIGHANGLER_STOP;
  else if( sig_kernel_coredump(sig) )
    return OO_SIGHANGLER_CORE;
  else if( sig_kernel_ignore(sig) )
    return OO_SIGHANGLER_IGN_BIT;
  else
    return OO_SIGHANGLER_TERM;
}
Example #2
0
static struct pid *good_sigevent(sigevent_t * event)
{
	struct task_struct *rtn = current->group_leader;
	int sig = event->sigev_signo;

	if ((event->sigev_notify & SIGEV_THREAD_ID ) &&
		(!(rtn = find_task_by_vpid(event->sigev_notify_thread_id)) ||
		 !same_thread_group(rtn, current) ||
		 (event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_SIGNAL))
		return NULL;

	if (((event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE) &&
	    (sig <= 0 || sig > SIGRTMAX || sig_kernel_only(sig) ||
	     sig_kernel_coredump(sig)))
		return NULL;

	return task_pid(rtn);
}