This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: struct sigcontext err field values


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]