Exemple #1
0
void set_all_sigactions(){

	set_sigaction( SIGILL, execute_on_sigfault );
	set_sigaction( SIGFPE, execute_on_sigfault );
	set_sigaction( SIGSEGV, execute_on_sigfault );
	set_sigaction( SIGBUS, execute_on_sigfault );
	set_sigaction( SIGTRAP, execute_on_sigfault );

}
Exemple #2
0
int ProcSignal::sigaction(int sig, const struct sigaction *new_act, struct sigaction *old_act)
{
    //  Error check
    if (sig < 1 || sig > NSIG)
    {
        return EINVAL;
    }

    lock();

    if (old_act)
    {
        /* Get a copy of the old act */
        *old_act = get_sigaction(sig);
    }

    if (new_act)
    {
        set_sigaction(sig, *new_act);
    }

    unlock();

    return 0;
}