Subject: Re: port-i386/851: Patch to pass the address of a protection fault to a signal handler
To: None <tech-kern@NetBSD.ORG>
From: Christos Zoulas <email@example.com>
Date: 03/08/1995 21:26:36
In article <9503081938.AA04634@bach> "Gordon Ross" <firstname.lastname@example.org> writes:
>Note that POSIX 1003.1B specifies what the arguments for a
>signal handler should be. The handler should be called as:
> void handler(int signum, siginfo_t *info, void *)
>The third arg is traditionally the sigcontext_t pointer,
>but its structure is not defined by the standard.
>The second arg points to a siginfo_t which has: (at least)
> int si_signo;
> int si_code; /* SI_USER, SI_QUEUE, SI_TIMER, ... */
> union sigval si_value;
> /* may contain other info here. */
>Several systems I looked at put the faulting address in si_value
>when signaling faults for which that makes sense (i.e. SIGSEGV,
>SIGBUS, SIGILL, SIGFPE). Another trick I like is to set the
>si_code member to something "useful" for faults, but normally
>it should just contain what NetBSD now passes as the "code".
I have done that already for the svr4 emulation. I am still debugging
some stuff, but soon I'll have it ready.