diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/signal/siginterrupt.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/signal/siginterrupt.c b/src/signal/siginterrupt.c index 283bd65c..0c2d505a 100644 --- a/src/signal/siginterrupt.c +++ b/src/signal/siginterrupt.c @@ -1,8 +1,18 @@ +#include "sys/types.h" #include <signal.h> int siginterrupt(int sig, int flag) { - return 0; + 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); } /* |
