Re: [Fwd: sigcontext on Linux-ppc in user space]

From: Kevin B. Hendricks (khendricks@ivey.uwo.ca)
Date: Thu Jan 25 2001 - 13:44:47 EST


Hi,

If it matters I am running some kernel fixes to enable RT signal handling properly.
A version of this patch was supposed to be included into the 2.4 series but I don't work with those kernels so I never checked to see if it was ever included.

I have attached the patch which should apply cleanly over stable 2.2 kernels just in case it helps.

By the way, this was not my patch it was contributed awhile ago by someone else.

The 2.3.XX version is out there someplace, perhaps someone remembers where. I backported it to my stable kernel.

Hope this helps,

Kevin




On Thursday, January 25, 2001, at 01:10 PM, Kevin B. Hendricks wrote:

>
> Hi,
>
> Here is what I get from running it on my system (ppc linux with 2.2.15 kernel with some mods
> and glibc-2.1.3).
>
> But no segfault.
>
> Kevin
>
>
> [kbhend@localhost ~]$ gcc -O2 -ojunk junk.c
> [kbhend@localhost ~]$ ./junk
> SIGUSR1 = 10
> scp = 7fffe9a4
> scp->signal = 0
> [kbhend@localhost ~]$
>
>
>
>
> On Thursday, January 25, 2001, at 10:09 AM, jekacur@ca.ibm.com wrote:
>
> > #include <stdio.h>
> > #include <signal.h>
> >
> > /* Function Prototypes */
> > void install_sigusr1_handler(void);
> > void sigusr_handler(int , siginfo_t *, struct sigcontext * scp);
> >
> > int main(void)
> > {
> > install_sigusr1_handler();
> > printf("SIGUSR1 = %d\n", SIGUSR1);
> > raise(SIGUSR1);
> > exit(0);
> > }
> >
> > void install_sigusr1_handler(void)
> > {
> > struct sigaction newAct;
> >
> > if (sigemptyset(&newAct.sa_mask) != 0) {
> > fprintf(stderr, "Warning, sigemptyset failed.\n");
> > }
> >
> > newAct.sa_flags = 0;
> > newAct.sa_flags |= SA_SIGINFO | SA_RESTART;
> >
> > newAct.sa_sigaction = (void
> > (*)(int,siginfo_t*,void*))sigusr_handler;
> >
> > if (sigaction(SIGUSR1, &newAct, NULL) != 0) {
> > fprintf(stderr, "Couldn't install SIGUSR1 handler.\n");
> > fprintf(stderr, "Exiting.\n");
> > exit(1);
> > }
> > }
> >
> > void sigusr_handler(int signo, siginfo_t *siginfp, struct sigcontext * scp)
> > {
> > printf("scp = %08x\n", scp);
> > printf("scp->signal = %d\n", scp->signal);
> > }
> >
> >
>
> ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
>
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jan 31 2001 - 21:00:22 EST