Understanding command line signals in C++ aka signal.h

95 pts.
Tags:
C
Shell commands
Shells
SIGINT
signal.h
SIG_IGN
Typedef
Hi all, here is some code I am trying to understand. The two main things that I do not get are the reasoning behind the typedef, and the reason for saying signal(SIGINT, SIG_IGN); Thanks in advance for any help! Wikipedia was useful but only got me so far crab

____________________________________ typedef void (*sighandler_t)(int); void handle_signal(int signo) { // return to shell printf("n[MY_SHELL ] "); // Force stdout to flush its buffers fflush(stdout); } int main(int argc, char* argv[]) { signal(SIGINT, SIG_IGN); signal(SIGINT, handle_signal);

Answer Wiki

Thanks. We'll let you know when a new response is added.

Could you please provide a link in which we can see the complete files ?
Could you also tell us what is the main function suposed to do (its goal) ?
Thanks.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following