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
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _