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
What language is shell scripting?
How will you connect to a database server from linux?
c program which behaves like a shell(command interpreter). it has its own prompt say "NewShell$".any normal shell command is executed from your shell by starting a child process to execute a system program corrosponding to the command
What is echo in shell?
What is $1 in shell scripting?
What is shell chemistry?
What are the advantages of using shell scripts?
What is the command to find out users on the system?
What is a shell script in windows?
Why is it called a shell?
What is shell geeksforgeeks?
What does $$ mean in shell script?
Write the syntax for "if" conditionals in linux?
What command needs to be used to take the backup?
What is bash eval?