RE: force_sig_info

From: Davide Libenzi
Date: Sun Sep 05 2004 - 08:36:58 EST


On Sun, 5 Sep 2004, Zach, Yoav wrote:

> >-----Original Message-----
> >From: Linus Torvalds [mailto:torvalds@xxxxxxxx]
> >Sent: Friday, September 03, 2004 21:12
> >To: Yoav Zach
> >Cc: akpm@xxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Zach, Yoav
> >Subject: Re: force_sig_info
> >
> >
> >Why are you blocking signals that you want to get? Sounds like
> >a bug in
> >your program.
>
> It's a translator - it emulates the behavior of the translated
> 'process', which is the one that sets the signal mask. On the
> other hand, it has its own logic, which requires handling of
> certain HW exceptions. In 2.4, signals that were raised due to
> HW exceptions could be handled by the translator regardless of
> the mask that was set by the translated process. We lost this
> ability in 2.6. It will be very good for our product, and I
> believe any similar product where a native process emulates
> behavior of another process, if we could have this ability
> back.

Below is the latest patch I posted (applies on some Jun 2004 2.6.x) to
bring 2.6 back to the 2.4 behaviour, but then it has been decided to leave
2.6 as is.



- Davide




--- a/kernel/signal.c 2004-06-28 14:28:51.000000000 -0700
+++ b/kernel/signal.c 2004-06-28 14:29:31.000000000 -0700
@@ -820,8 +820,9 @@
int ret;

spin_lock_irqsave(&t->sighand->siglock, flags);
- if (sigismember(&t->blocked, sig) || t->sighand->action[sig-1].sa.sa_handler == SIG_IGN) {
+ if (t->sighand->action[sig-1].sa.sa_handler == SIG_IGN)
t->sighand->action[sig-1].sa.sa_handler = SIG_DFL;
+ if (sigismember(&t->blocked, sig)) {
sigdelset(&t->blocked, sig);
recalc_sigpending_tsk(t);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/