Skip to content

Commit

Permalink
add kill
Browse files Browse the repository at this point in the history
  • Loading branch information
rsc committed Aug 8, 2007
1 parent e695b84 commit e092482
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ _init : init.o $(ULIB)
$(OBJDUMP) -S _init > init.asm
$(OBJDUMP) -t _init | awk '/SYMBOL TABLE/ { go=1; next } go {print $$1, $$NF}' >init.sym

_sh : sh.o $(ULIB)
$(LD) -N -e main -Ttext 0 -o _sh sh.o $(ULIB)
$(OBJDUMP) -S _sh > sh.asm
_kill : kill.o $(ULIB)
$(LD) -N -e main -Ttext 0 -o _kill kill.o $(ULIB)
$(OBJDUMP) -S _kill > kill.asm

_ls : ls.o $(ULIB)
$(LD) -N -e main -Ttext 0 -o _ls ls.o $(ULIB)
Expand All @@ -100,14 +100,18 @@ _rm : rm.o $(ULIB)
$(LD) -N -e main -Ttext 0 -o _rm rm.o $(ULIB)
$(OBJDUMP) -S _rm > rm.asm

_sh : sh.o $(ULIB)
$(LD) -N -e main -Ttext 0 -o _sh sh.o $(ULIB)
$(OBJDUMP) -S _sh > sh.asm

_zombie: zombie.o $(ULIB)
$(LD) -N -e main -Ttext 0 -o _zombie zombie.o $(ULIB)
$(OBJDUMP) -S _zombie > zombie.asm

mkfs : mkfs.c fs.h
cc -o mkfs mkfs.c

UPROGS=usertests _echo _cat _init _sh _ls _mkdir _rm _zombie
UPROGS=usertests _echo _cat _init _kill _ls _mkdir _rm _sh _zombie
fs.img : mkfs README $(UPROGS)
./mkfs fs.img README $(UPROGS)

Expand Down
17 changes: 17 additions & 0 deletions kill.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "types.h"
#include "stat.h"
#include "user.h"

int
main(int argc, char **argv)
{
int i;

if(argc < 1){
printf(2, "usage: kill pid...\n");
exit();
}
for(i=1; i<argc; i++)
kill(atoi(argv[i]));
exit();
}

0 comments on commit e092482

Please sign in to comment.