Added kill

This commit is contained in:
qorg11 2020-06-03 03:30:25 +02:00
parent 559fd48d89
commit 9c7fec7479
Signed by: qorg11
GPG Key ID: 343FC20A4ACA62B9
1 changed files with 29 additions and 0 deletions

29
src/kill.c Normal file
View File

@ -0,0 +1,29 @@
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
int
main(int argc, char *argv[])
{
int sig = 0;
pid_t pid;
if(argc == 2)
{
sig = 15;
pid = atoi(argv[1]);
}
else if(argc == 3)
{
sig = abs(atoi(argv[1]));
pid = abs(atoi(argv[2]));
printf("Here 2\n");
}
else
{
printf("Specify who to kill\n %i",argc);
}
kill(pid,sig);
}