Skip to contentSkip to conversation

sigcontext on Linux-ppc in user space

DISCUSSION John Kacur 2 participants 2 messages Jan 23, 2001 – Jan 24, 2001

lore
Share & tools
lore

John Kacur

author
#0 lore raw

Does anyone know how to get at the struct sigcontext in a signal handler on Linux for powerpc? sigaction of course lets you create a signal handler as a function with the prototype void(*)(int, siginfo_t *, void *)
where the last argument, a pointer to void, is the sigcontext. I believe that the last argument is NOT defined by POSIX and so is implementation dependent.

On Intel it seems sufficient to use #include <asm/sigcontext.h> to get the definition of struct sigcontext, and then get the values you'd like out of the signal handler. But on Linux for powerpc, the same thing doesn't work. Does anyone know what the trick is here to accomplish this?

Thanks in advance
John Kacur
[email protected]
[email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Quoted 8 lines · John Kacur

Does anyone know how to get at the struct sigcontext in a signal handler on Linux for powerpc? sigaction of course lets you create a signal handler as a function with the prototype void(*)(int, siginfo_t *, void *)
where the last argument, a pointer to void, is the sigcontext. I believe that the last argument is NOT defined by POSIX and so is implementation dependent.

Quoted 5 lines

On Intel it seems sufficient to use #include <asm/sigcontext.h> to get the definition of struct sigcontext, and then get the values you'd like out of the signal handler. But on Linux for powerpc, the same thing doesn't work. Does anyone know what the trick is here to accomplish this?

You should never include kernel headers in user space.

If you have a glibc 2.1 (or newer) based system, just include <signal.h> which will include <bits/sigcontext.h> with the struct (this works on all architectures).

Andreas

Signature · 8 lines
 Andreas Jaeger
  SuSE Labs [email protected]
   private [email protected]
    http://www.suse.de/~aj
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/