hey jim. my prof gave me this program...
that program catches the signal Ctrl C which if I'm not mistaken is one of the kill commands in linux. i can't remember what specific kill command is that. my question is how does the catchsignal function learn which signal to ignore? thanks.
Last edited by blowtorch; 12-11-2006 at 05:22 AM..
my question is how does the catchsignal function learn which signal to ignore?
Only signal(s) you 'intercept' will be handled by catchsignal.
So you cant kill that program with ctrl-c but try delivering it signal like TERM
and you'll see ...
Only signal(s) you 'intercept' will be handled by catchsignal.
So you cant kill that program with ctrl-c but try delivering it signal like TERM
and you'll see ...
yup, i know it wouldn't be able to ignore the sigterm...i just want to know how it intercept the ctrl-c...?
yup, i know it wouldn't be able to ignore the sigterm...i just want to know how it intercept the ctrl-c...?
This bunch of statements is where the signal handler is being setup. The "act.sa_handler=catchsignal;" statement spells out the function that will be used (catchsignal). And the statement signaction(SIGINT,&act,NULL) specifies that values from the act structure are to be associated with the reception of SIGINT.
This bunch of statements is where the signal handler is being setup. The "act.sa_handler=catchsignal;" statement spells out the function that will be used (catchsignal). And the statement signaction(SIGINT,&act,NULL) specifies that values from the act structure are to be associated with the reception of SIGINT.