Subject: Re: trapsignal() or p_emul->e_trapsignal() ?
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-kern
Date: 01/03/2004 20:28:34
In article <20040103193943.GA1240@drowsy.duskware.de>,
Martin Husemann <martin@duskware.de> wrote:
>What's the official rule about trapsignal(9)?
>
>For i386 this change replaced it with calls to 
>
>   (*p->p_emul->e_trapsignal)(l, &ksi);
>
>----------------------------
>revision 1.161
>date: 2001/06/18 02:00:49;  author: christos;  state: Exp;  lines: +10 -10
>branches:  1.161.2;
>Add an e_trapsignal member to struct emul, so that emulated processes can
>send the appropriate signal depending on the trap type.
>----------------------------
>
>but other archs still just call trapsignal().
>
>Is this an oversight that should be fixed, or does it have some non obvious
>reason?

Well, the trapsignal emulation override function is used for some
emulations to change the signal information passed to the userland
programs. On some architectures that have no emulations, this just
slows down things by making the procedure call indirect. I would
say though that since this is not a very frequently used code path,
using p->p_emul->e_trapsignal is better for consistency reasons.

christos