Subject: Re: Programming question - signal handlers
To: None <netbsd-users@netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: netbsd-users
Date: 07/08/2002 13:16:48
[ On Monday, July 8, 2002 at 13:25:45 (+0100), David Laight wrote: ]
> Subject: Re: Programming question - signal handlers
>
> kill( 0, SIGSEGV ) within the handler should dump a core.
> (because the handler (should) be inactive inside itself)

Won't it either be blocked or lost?  POSIX signal handlers are not unset
when a signal is received.  As the sigaction(2) manual page states:

     Signal routines execute with the signal that caused their invocation
     blocked, but other signals may yet occur.  A global signal mask defines

I suppose one could call sigprocmask(2) to unblock the signal that
invoked the handler, but one would first have to change the disposition
of the signal so that the handler isn't just invoked again.

Also, so far as I know the kernel makes no special allowance for
processes sending themselves signals -- the semantics should be exactly
the same as if the kernel or another authorised process sends them a
signal.

-- 
								Greg A. Woods

+1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>