[PATCH] kill(-1,sig)

From: Andries.Brouwer@cwi.nl
Date: Fri Dec 14 2001 - 12:34:48 EST


The new POSIX 1003.1-2001 is explicit about what kill(-1,sig)
is supposed to do. Maybe we should follow it.

Andries

--- signal.c~ Thu Nov 22 01:26:27 2001
+++ signal.c Fri Dec 14 18:27:34 2001
@@ -649,8 +649,10 @@
 /*
  * kill_something_info() interprets pid in interesting ways just like kill(2).
  *
- * POSIX specifies that kill(-1,sig) is unspecified, but what we have
- * is probably wrong. Should make it like BSD or SYSV.
+ * POSIX (2001) specifies "If pid is -1, sig shall be sent to all processes
+ * (excluding an unspecified set of system processes) for which the process
+ * has permission to send that signal."
+ * So, probably the process should also signal itself.
  */
 
 static int kill_something_info(int sig, struct siginfo *info, int pid)
@@ -663,7 +665,7 @@
 
                 read_lock(&tasklist_lock);
                 for_each_task(p) {
- if (p->pid > 1 && p != current) {
+ if (p->pid > 1) {
                                 int err = send_sig_info(sig, info, p);
                                 ++count;
                                 if (err != -EPERM)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Dec 15 2001 - 21:00:28 EST