Subject: Re: Incorrect sigcontext when signal handler called??
To: Sanjay Lal <sanjayl@iqmail.net>
From: Roger Brown <rogerhb@xtra.co.nz>
List: port-macppc
Date: 04/04/2000 05:32:19
I thought that signal handlers were

void handler(int signum);

Roger
----------
>From: Sanjay Lal <sanjayl@iqmail.net>
>To: port-macppc@netbsd.org
>Subject: Incorrect sigcontext when signal handler called??
>Date: Mon, Apr 3, 2000, 8:19 pm
>

>I am running NetBSD 1.4.1 for the mac/ppc. There might be a bug here, I
>am not sure.
>The sigconext parameter (scp) passed
>as parameter 3 to the signal handler might be incorrect. Any access to
>this space,
>(copying it, printing etc) hangs the process completely.
>Has anyone else seen this or am I doing something completely wrong here?
>
>Any help would be greatly appreciated.
>
>Thanks in advance,
>
>Sanjay
>sanjayl@iqmail.net
>
>
>The small program below reproduces it:
>#include <stdio.h>
>#include <signal.h>
>
>void
>sig_handler (int sig, int code, struct sigcontext * scp);
>
>int main (void)
>{
>        struct sigaction act;
>
>        /* Initialise the global signal action structure: */
>        sigfillset(&act.sa_mask);
>        act.sa_handler = (void (*) ()) sig_handler;
>        act.sa_flags = 0;
>
>        if (sigaction (SIGINT, &act, NULL) != 0)
>                printf("sigaction failed\n");
>
>
>        sleep(100);
>}
>
>void
>sig_handler (int sig, int code, struct sigcontext * scp)
>{
>        printf("sig: %d\tcode: %d\tscp: 0x%X\n", sig, code, scp);
>        printf("scp.sc_frame[r1]: 0x%X\n", scp->sc_frame.fixreg[1]);
>}
>