u may also use signal function. I don't think it has any difference with sigset in Linux. In unix after catching a signal it restores the handler to its default function. In any case if are not planning to exit after catching the signal u may use something like that:
[CODE]
Code:
#include <signal.h>
signal(SIGTERM, sigterm_handler); /* put this in main() */
void sigterm_handler(int signo){
signal(SIGTERM, sigterm_handler);
/* the code u want to execute every time u catch a SIGTERM */
}
also Ctrl+C = SIGINT and not SIGTERM