Modify catchsignal.c to only allow user to break the program when they use Ctrl-C twice. Modify this file to allow user to break the program when they use Ctrl-C twice. */ #include
Modify catchsignal.c to only allow user to break the program when they use Ctrl-C twice. Modify this file to allow user to break the program when they use Ctrl-C twice. */ #include
Related questions
Question
Modify catchsignal.c to only allow user to break the
Modify this file to allow user to break the program when they use Ctrl-C twice.
*/
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
void sig_handler()
{
printf("I got an INT signal\n");
}
int main(void)
{
signal(SIGINT, sig_handler);
int i;
while(1){
printf("%d\n",i);
i++;
sleep(1);
}
return 0;
}
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
