Understanding command line signals in C++ aka signal.h
95 pts.
0
Q:
Understanding command line signals in C++ aka signal.h
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);
ASKED: Sep 18 2008  6:27 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
29855 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
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.
Last Answered: Sep 18 2008  2:56 PM GMT by Carlosdl   29855 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0