[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MACH exceptions



Sandro,

So I've been playing around with MACH exceptions, and I can't seem to get
them to work for generic signals (e.g. SIGINT).  If my test program tries
to write a bogus address, I get the exception, but if I hit ^C, it just
dies.  (Code in /../ardath/usr/wlott/foo/exctest.c)

Is there anyway to get this to work?  (Before you say ``use MACH 3.0,''
remember the problems we caused when we asked people to use the latest
kernel... :-)

If there isn't any way to make this work, is there any way I can restrict
which thread gets hit with a signal?  Would something like this work:

main()
{
    sigsetmask(-1);
    /* setup handlers for every signal */
    cthread_detach(cthread_yield(handle_signals));
    ....
}

static void handle_signals()
{
    while (1) {
	sigblock(0);
    }
}

I would really like to be able to totally ignore unix signals when dealing
with threads, but if I can't control which thread gets the signal, it's
going to be a royal pain in the posterior.

-William