From 9c7fec74799adad5e38cb42dfb476c3b5d8cbd6e Mon Sep 17 00:00:00 2001 From: qorg11 Date: Wed, 3 Jun 2020 03:30:25 +0200 Subject: [PATCH] Added kill --- src/kill.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/kill.c diff --git a/src/kill.c b/src/kill.c new file mode 100644 index 0000000..a18f2a1 --- /dev/null +++ b/src/kill.c @@ -0,0 +1,29 @@ +#include +#include +#include + +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); +}