From Andrey Mirtchovski - The explanation is in the 9fans mail list, the subject is "APE exit()" Basically it resolves the issue of a suicide that kills too far back, including the parent shell. Reference: /n/sources/patch/applied/apelib_kill Date: Sat Mar 3 14:49:00 CET 2007 Signed-off-by: lucio@proxima.alt.za --- /sys/src/ape/lib/ap/plan9/kill.c Sat Mar 3 14:40:50 2007 +++ /sys/src/ape/lib/ap/plan9/kill.c Sat Mar 3 14:40:41 2007 @@ -46,9 +46,12 @@ if(pid < 0) { sid = getpgrp(); mpid = getpid(); - setpgid(mpid, -pid); - r = note(mpid, msg, "/proc/%d/notepg"); - setpgid(mpid, sid); + if(setpgid(mpid, -pid) > 0) { + r = note(mpid, msg, "/proc/%d/notepg"); + setpgid(mpid, sid); + } else { + r = -1; + } } else if(pid == 0) r = note(getpid(), msg, "/proc/%d/notepg"); else