Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



c program the catches the ctrl-c(SIGINT) Signal for the first time and prints a output rather and ..

Answer / dwarf

on Linux:
man 2 signal
for signum use SIGINT

Is This Answer Correct ?    0 Yes 0 No

c program the catches the ctrl-c(SIGINT) Signal for the first time and prints a output rather and ..

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

Post New Answer

More Shell Script Interview Questions

How will you pass and access arguments to a script in linux?

0 Answers  


What does $@ mean in shell?

0 Answers  


What is the fastest scripting language?

0 Answers  


How to make userdefined variables to available for all other shells?

4 Answers  


What is mac default shell?

0 Answers  


What language is bash written in?

0 Answers  


How can the contents of a file inside jar be read without extracting in a shell script?

0 Answers  


How do we create command aliases in a shell?

0 Answers  


Is shell scripting a programming language?

0 Answers  


Hi All, Is it possible to create one file name only space or space in file name in UNIX and we can able to run that on Unix?

2 Answers   Cap Gemini,


How will you print the login names of all users on a system?

0 Answers  


Print the 10th line without using tail and head command.

0 Answers  


Categories