[PATCH 3/11] pass task_struct in send_signal()

From: Chris Wright
Date: Tue May 11 2004 - 03:52:18 EST


Update send_signal() api to allow passing the task receiving the signal.
This is necessary to ensure signals generated out of process context can
be charged to the correct user.

===== kernel/signal.c 1.115 vs edited =====
--- 1.115/kernel/signal.c Mon May 10 03:04:00 2004
+++ edited/kernel/signal.c Mon May 10 16:16:13 2004
@@ -698,7 +698,8 @@
}
}

-static int send_signal(int sig, struct siginfo *info, struct sigpending *signals)
+static int send_signal(int sig, struct siginfo *info, struct task_struct *t,
+ struct sigpending *signals)
{
struct sigqueue * q = NULL;
int ret = 0;
@@ -797,7 +798,7 @@
if (LEGACY_QUEUE(&t->pending, sig))
goto out;

- ret = send_signal(sig, info, &t->pending);
+ ret = send_signal(sig, info, t, &t->pending);
if (!ret && !sigismember(&t->blocked, sig))
signal_wake_up(t, sig == SIGKILL);
out:
@@ -998,7 +999,7 @@
* We always use the shared queue for process-wide signals,
* to avoid several races.
*/
- ret = send_signal(sig, info, &p->signal->shared_pending);
+ ret = send_signal(sig, info, p, &p->signal->shared_pending);
if (unlikely(ret))
return ret;


-
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/