Re: SPARC and SA_SIGINFO signal handling

From: Christophe Rhodes (csr21@cam.ac.uk)
Date: Wed Oct 31 2001 - 04:43:43 EST


On Tue, Oct 30, 2001 at 12:51:34PM -0800, David S. Miller wrote:
>
> You're doing something really wrong, it works perfectly
> fine here:
>
> ? cat test.c
> #include <stdlib.h>
> #include <sys/ucontext.h>
> #include <signal.h>
>
> void sigsegv_handler (int signo, siginfo_t *info, void *data) {
> if (info != 0)
        ^^^^

This gets me the siginfo struct; this is fine, and I'm happy with this
part.

However, what I don't see to get at is the usercontext/ucontext
structure containing register contents and so on, which as far as I am
aware should be in the third (data) argument to the sa_sigaction-type
sighandler; that's where I'm getting my problems.

> exit(1);
> exit(0);
> }
> [...]

Change the info above to data, and...

[ x86 does what I expect... ]
csr21@lambda:~$ uname -a
Linux lambda 2.4.13-ac4 #1 Mon Oct 29 18:26:51 GMT 2001 i686 unknown
csr21@lambda:~$ ./foo
csr21@lambda:~$ echo $?
1

[ sparc doesn't ]
csr21@caligula:~$ uname -a
Linux caligula 2.4.6 #1 SMP Sun Sep 30 16:40:07 BST 2001 sparc64
unknown
csr21@caligula:~$ ./foo
csr21@caligula:~$ echo $?
0

Thanks,

Christophe

-- 
Jesus College, Cambridge, CB5 8BL                           +44 1223 510 299
http://www-jcsu.jesus.cam.ac.uk/~csr21/                  (defun pling-dollar 
(str schar arg) (first (last +))) (make-dispatch-macro-character #\! t)
(set-dispatch-macro-character #\! #\$ #'pling-dollar)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



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