1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#if 0 #include <sys/types.h> #include <signal.h> int siginterrupt(int sig, int flag) { struct sigaction sa = { 0 }; int ret = -1; sigaction(sig, NULL, &sa); if (flag) { sa.sa_flags &= ~SA_RESTART; } else { sa.sa_flags |= SA_RESTART; } return sigaction(sig, &sa, NULL); } /* XOPEN(400) */ #endif