Subject: Re: lib/30585: Sigcontext misfilled in pthread mode.
To: None <gnats-bugs@netbsd.org>
From: Martin Husemann <martin@duskware.de>
List: netbsd-bugs
Date: 06/23/2005 17:35:57
On Thu, Jun 23, 2005 at 03:25:00PM +0000, guilhem.lavaux@free.fr wrote:
> void segvHandler(int sig, int code, struct sigcontext *sc)
> {
> fprintf(stderr, "caught SEGV (sp=%p, pc=%p)\n", sc->sc_sp, sc->sc_pc);
> exit(0);
> }
[..]
> struct sigaction newact, oldact;
>
> newact.sa_handler = segvHandler;
> sigemptyset(&newact.sa_mask);
That is an incompatible pointer type, isn't it? According to the man page
sa_handler is just
void (*sa_handler)(int sig);
Better use sa_sigaction and SA_SIGINFO?
Martin