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 |
Tell something about the super block in shell scripting?
c program to display the information of given file similar to givan by the unix or linux command ls -l
What command needs to be used to take the backup?
How to declare functions in unix shell script?
how to separate the even and odd number generated from one file to two separate file i.e. even numbers in file1.txt and odd numbers in file2.txt
1.Write a script, which converts a number from binary to hexadecimal format or vice versa.
How can we find the process name from its process id?
shell script for reverse the string
How to initialize a directory size to a variable??
Can we run shell script in windows?
Write a shell script to looking at the log file to see if the test has passed or not
What can scripts do?