I have a project for school and I need some help.
I’m working in C and I have a server and a client. In server I make a new process for each client with fork. My question is: if I close the server with CTRL+C, how do I kill all the remaining processes ? Thanks
I have a project for school and I need some help. I’m working in
Share
This will do it for you in the shell:
In C, you can try:
in the
SIGINTsignal handler for your main server process to kill all the processes in its process group, which should include its children.