C shell: kill process syntax -
I am trying to write my own shell I am wondering how 'kill' in command line work To call. For example,
shell & gt; Kill 2: Process 2 is killed
Line 1 is user input 'Beat 2'
Line 2 is a proxy message from the program that has been done.
I know that I have to take Pod as an argument which I believe and SIGKILL sends the signal. Using something like
kill (pid, SIGKILL);
When I kill the user in 'C2 implementation', how do I add this killing function to answer? I feel that it is getting tough time for the implementation with command line arguments I might need strtok / atoi? Thank you.
contains # lt; Stdio.h & gt; Sys / types.h & gt; #includes & lt; #to & lt include, signal.h & gt; Int main (int argc, char ** argv) {if (argc & lt; 3) {printf ("use: ./kill OPERATION (kill / cont) pid \ n"); Return -1; } If (SRCMP (ARGV [1], "kill") == 0} {printf ("kill: \ n"); Kill (Atto (Arjavi [2]), Sigil); } And if (strcmp (argv [1], "cont") == 0} {printf ("cont: \ n"); Kill (Atto (Archaea [2]), Sig Cunt;} Other {printf ("Delete default: \ n"); Mar (Atto (Urgee [2]), Sigil);} Return 0;}
Comments
Post a Comment