1 fd04aace 2003-11-23 devnull #include <u.h>
2 f9355efb 2003-11-24 devnull #define NOPLAN9DEFINES
3 fd04aace 2003-11-23 devnull #include <libc.h>
5 d2c4ee9e 2003-11-24 devnull #include <signal.h>
8 fd04aace 2003-11-23 devnull extern int _p9strsig(char*);
11 fd04aace 2003-11-23 devnull postnote(int who, int pid, char *msg)
15 fd04aace 2003-11-23 devnull sig = _p9strsig(msg);
16 fd04aace 2003-11-23 devnull if(sig == 0){
17 fd04aace 2003-11-23 devnull werrstr("unknown note");
18 fd04aace 2003-11-23 devnull return -1;
21 0cc1faf0 2021-01-14 rsc if(pid <= 0){
22 0cc1faf0 2021-01-14 rsc werrstr("bad pid in postnote");
26 fd04aace 2003-11-23 devnull switch(who){
28 fd04aace 2003-11-23 devnull werrstr("bad who in postnote");
29 fd04aace 2003-11-23 devnull return -1;
30 fd04aace 2003-11-23 devnull case PNPROC:
31 fd04aace 2003-11-23 devnull return kill(pid, sig);
32 fd04aace 2003-11-23 devnull case PNGROUP:
33 fd04aace 2003-11-23 devnull if((pid = getpgid(pid)) < 0)
34 fd04aace 2003-11-23 devnull return -1;
35 fd04aace 2003-11-23 devnull return killpg(pid, sig);