Subject: Re: lib/30585: Sigcontext misfilled in pthread mode.
To: None <lib-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Martin Husemann <martin@duskware.de>
List: netbsd-bugs
Date: 06/23/2005 15:37:02
The following reply was made to PR lib/30585; it has been noted by GNATS.

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: lib-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: lib/30585: Sigcontext misfilled in pthread mode.
Date: Thu, 23 Jun 2005 17:35:57 +0200

 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