From 4f53303d8dd06e6c34491275e0d80b43082d247f Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 29 Jul 2021 00:10:45 +0000 Subject: Add sig_altignore() Signed-off-by: Laurent Bercot --- src/include/skalibs/sig.h | 1 + src/libstddjb/sig_altignore.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/libstddjb/sig_altignore.c (limited to 'src') diff --git a/src/include/skalibs/sig.h b/src/include/skalibs/sig.h index ccf5dac..1385756 100644 --- a/src/include/skalibs/sig.h +++ b/src/include/skalibs/sig.h @@ -14,6 +14,7 @@ typedef sig_func *sig_func_ref ; extern int sig_catch (int, sig_func_ref) ; #define sig_restore(sig) sig_catch((sig), SIG_DFL) #define sig_ignore(sig) sig_catch((sig), SIG_IGN) +extern int sig_altignore (int) ; extern void sig_restoreto (sigset_t const *, unsigned int) ; diff --git a/src/libstddjb/sig_altignore.c b/src/libstddjb/sig_altignore.c new file mode 100644 index 0000000..304d6f8 --- /dev/null +++ b/src/libstddjb/sig_altignore.c @@ -0,0 +1,15 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include + +static void sig_nop (int sig) +{ + (void)sig ; +} + +int sig_altignore (int sig) +{ + return sig_catch(sig, &sig_nop) ; +} -- cgit v1.2.3