From 834a4930e8d9b33373fbe1d636acebb87b62c2fd Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Thu, 13 Aug 2020 19:45:54 -0400 Subject: implement --- src/signal/siginterrupt.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') 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 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); } /* -- cgit v1.2.1