I am writing a shell, now it comes to control the child process.
When I use signal (SIGTERM, SIG_DFL);
in the child process,
the signal SIGINT is generated by Ctrl + C, and that signal terminates whole the OS shell.
how can I just terminate the process e.g βcatβ only, but not whole shell?? Should I use somethings like:
void sig_handler(int sig) {
if(sig ==SIGINT)
{
kill(pid);
}
}
Really thanks a slot.