Subject: port-i386/851: Patch to pass the address of a protection fault to a signal handler
To: None <>
From: Gordon W. Ross <>
List: tech-kern
Date: 03/08/1995 14:38:15
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".

Let's standardize!