-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This are updated versions of the patch Ingo sent some time ago to implement a new tgkill() syscall which can in theory replace kill() and tkill(). The first patch is just Ingo's patch, relative to the current BK sources, plus the fix to send the correct si_pid value. The second patch implementation the additional functionality Linus proposed. They allow using tgkill as a replacement for kill/tkill by recognizing special -1 values. This is the interdiff: - --- linux-2.5/kernel/signal.c 2003-07-07 12:39:36.000000000 -0700 +++ linux-2.5/kernel/signal.c 2003-07-07 13:03:15.000000000 -0700 @@ -2104,8 +2104,12 @@ int error; struct task_struct *p; + /* Handle tgkill(tgid, -1, sig) like kill(tgid, sig). */ + if (pid == -1) + return sys_kill(tgid, sig); + /* This is only valid for single tasks */ - - if (pid <= 0 || tgid <= 0) + if (pid <= 0 || tgid < -1 || tgid == 0) return -EINVAL; info.si_signo = sig; @@ -2117,7 +2121,8 @@ read_lock(&tasklist_lock); p = find_task_by_pid(pid); error = -ESRCH; - - if (p && (p->tgid == tgid)) { + /* Handle tgkill(-1, pid, sig) like tkill(pid, sig). */ + if (p && (p->tgid == tgid || tgid == -1)) { error = check_kill_permission(sig, &info, p); /* * The null signal is a permissions and process existence I personally would think that this addition is overkill since we cannot get rid of the kill/tkill syscalls anyway. I've tested both patches. Having one of them included is really needed since many/most people still run with limited PID ranges (maybe due to legacy apps breaking) and the PID reuse can cause problems. Let me know if there are any problems. I'll try to address them right away. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/CdSE2ijCOnn/RHQRAiytAJwJq8BYPRu9Ep6U8krubKafW7nVwwCeKsq7 LKsQB68ROJYi8OrdUPFOZ5M= =HdOW -----END PGP SIGNATURE-----