lkml.org 
[lkml]   [2001]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: SPARC and SA_SIGINFO signal handling
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/

\
 
 \ /
  Last update: 2005-03-22 13:12    [W:0.053 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site