[lkml]   [2001]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectSPARC and SA_SIGINFO signal handling
Dear all,

I'm having trouble on SPARC/Linux (of both the 32 and 64 varieties)
getting at the third argument of POSIX sa_sigaction signal handlers.

Consider the following code (a simplified version of what I'm actually
trying to do):
--- Cut here ---
#include <stdlib.h>
#include <sys/ucontext.h>
#include <signal.h>

void sigsegv_handler (int signo, siginfo_t *info, void *data) {

int main () {
int *foo;
struct sigaction sa;

sa.sa_sigaction = sigsegv_handler;
sa.sa_flags = SA_SIGINFO | SA_RESTART;
sigaction(SIGSEGV, &sa, NULL);

foo = NULL;
*foo = 3;
return 0;
--- Cut here ---
Running under gdb reveals that, whereas on alpha, x86 and ppc the
third argument to sigsegv_handler is a pointer to a ucontext
structure, on sparc and sparc64 I get NULL.

Am I doing something wrong, or is the ucontext argument simply not yet
implemented on the sparc architecture?

Many thanks,

Jesus College, Cambridge, CB5 8BL +44 1223 510 299 (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
More majordomo info at
Please read the FAQ at

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