c program the catches the ctrl-c(SIGINT) Signal for the
first time and prints a output rather and exit on pressing
Ctrl-C again
Answer Posted / rakesh
#include <stdio.h>
#include <signal.h>
void sigproc(void);
main()
{
signal(SIGINT, sigproc);
printf("This program catches ctrl-c(SIGINT) signal for
first time and exit on pressing ctrl-c again\n");
for(;;);
/* infinite loop */
}
void sigproc()
{
signal(SIGINT, sigproc);
printf("you have pressed ctrl-c \n");
(void) signal(SIGINT,SIG_DFL);
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Is shell script a programming language?
Is shell and terminal the same?
How to set an array in linux?
What is the use of echo in shell script?
What is the command to find out today's date?
What is a batch file used for?
how to print the 2-d, 3-d arrays in unix shell script programs please answer thi questio to my mail venusaikumar@gmail.com
Explain about non-login shell files?
Explain about return code?
What is scripting used for?
Is powershell a language?
What is c in shell script?
What is the syntax of "nested if statement" in shell scripting?
how will you find the total disk space used by a specific user?
How do I run a bin bash script?