Various additions and fixes.

This commit is contained in:
rsc 2003-11-23 18:12:54 +00:00
parent 74f990ad84
commit fd04aacee1
57 changed files with 2176 additions and 159 deletions

34
src/lib9/postnote.c Normal file
View file

@ -0,0 +1,34 @@
#include <signal.h>
#include <u.h>
#define _NO9DEFINES_
#include <libc.h>
extern int _p9strsig(char*);
int
postnote(int who, int pid, char *msg)
{
int sig;
sig = _p9strsig(msg);
if(sig == 0){
werrstr("unknown note");
return -1;
}
switch(who){
default:
werrstr("bad who in postnote");
return -1;
case PNPROC:
return kill(pid, sig);
case PNGROUP:
if((pid = getpgid(pid)) < 0)
return -1;
return killpg(pid, sig);
}
}