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
Answers were Sorted based on User's Feedback
Answer / 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 |
write a shell program to check wheather a given string is pallindrome or not?
What are the advantages of shell scripting?
What makes c shell a more preferable option than the bourne shell?
What does path stand for?
What is the syntax of "nested if statement" in shell scripting?
What is a command line shell?
How to print pid of the current shell?
What is shell variable?
what is "umask"?
How to check if the previous command was run successfully?
Where are cowrie shells found?
Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.