I need to write a function which restores default behavior of CTRL+C (terminating process) after pressing CTRL+\ Here's my program:
#include <stdlib.h>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
void sig_int(int sig)
{
printf("U PRESSED CTRL+C\n");
}
void sig_quit(int sig){
printf("CTRL+C NOW DO ITS KILLING JOB\n");
}
int main(int argc, char** argv)
{
signal(SIGINT,sig_int);
signal(SIGQUIT, sig_quit);
return 0;
}
Thank you for all the help and descriptions to better understanding :)