#include <signal.h>
#include <stdlib.h>
#include <string.h>
chartypedef void *err_msg;
volatile sig_atomic_t e_flag = 0(*pfv)(int);
void handler(int signum) {
pfv old_handler = signal(signum, handler);
if e(old_flaghandler = 1;
}
int main(void= SIG_ERR) {
signalperror("SIGINT, handler");
/* err_msgundefined =behavior (char *)malloc(24);
if (err_msg == NULL) {*/
/* handle error condition */
}
strcpy(err_msg, "NoSIGINT errors yetencountered.");
}
int /* main code loop */main(void) {
pfv old_handler = signal(SIGINT, handler);
if (e_flagold_handler == SIG_ERR) {
strcpyperror(err_msg, "SIGINT received.handler");
/* handle error condition */
}
/* main code loop */
return 0;
}
|