Subject: SA_SIGINFO notes
To: None <tech-kern@netbsd.org>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: tech-kern
Date: 10/05/2003 23:33:19
The kernel bits for SIGINFO support for the sparc are there.
Two things that I noticed while working on this:
1. The i386 port supports clearing the SS_ONSTACK bit in setmcontext()
through the use of private flags (UC_SETSTACK/UC_CLRSTACK). The
vax port appears not to reset SS_ONSTACK at all.
Would it make sense to move UC_{SET,CLR}STACK to the MI ucontext.h
header so all ports can use this mechanism; possibly even by doing
it in kern_sig.c:setucontext().
2. In kern_sig.c:kpsendsig(), the `ksi_trap' is used to decide which
arguments to pass to sa_upcall(). I don't what it is used for,
but blindly using `ksi_trap' without further inspection of the
siginfo context seems like a bad idea. `ksi_trap' is only defined
for certain signal numbers, and its contents is MD even then.
E.g. it might just be file descriptor 0 in a SIGPOLL delivery, or
the user id of a process in a SIGCLD.. who knows?
-pk