This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: struct sigcontext err field values
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: Amittai Aviram <amittai dot aviram at yale dot edu>
- Cc: libc-help at sourceware dot org
- Date: Fri, 16 Oct 2009 11:52:59 -0400
- Subject: Re: struct sigcontext err field values
- References: <2C06C2F0-B576-46EA-A898-3CF29102169A@yale.edu>
On Thu, Oct 15, 2009 at 7:23 PM, Amittai Aviram <amittai.aviram@yale.edu> wrote:
> Can anybody please help me find out what the possible values are for the err
> field of the sigcontext structure (defined in
> /usr/include/asm/sigcontext.h), in particular if the signal is SIGSEGV--and
> where the constants for that field are defined? ?If the answer is
> machine-specific or OS-specific (or both), I'd like to know about 32-bit x86
> machines running Linux (Suse Open Linux 11). ?Thanks!
It's a machine-specific OS-specific undocumented structure. When the
OS handles a signal, it may write a signal context to the stack
(depends on OS and target), then it calls the signal handler. If the
signal handler asked for SA_SIGINFO, then a third parameter to the
signal handler is a ucontext_t cast to a void *. The ucontext_t
contains a sigcontext_t. The ucontext_t structure fully describes the
state of the process at the time of the signal, and the OS may use
this to unwind the signal handler once completed.
The best documentation is the Linux kernel source for x86 e.g. linux/arch/x86/*.
Cheers,
Carlos.