skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

commit 4f53303d8dd06e6c34491275e0d80b43082d247f
parent 9592bfd0dda7c575de07bce2c7a81b8432d845a4
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date:   Thu, 29 Jul 2021 00:10:45 +0000

 Add sig_altignore()

Signed-off-by: Laurent Bercot <ska@appnovation.com>

Diffstat:
Mpackage/deps.mak | 1+
Msrc/include/skalibs/sig.h | 1+
Asrc/libstddjb/sig_altignore.c | 15+++++++++++++++
3 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/package/deps.mak b/package/deps.mak @@ -481,6 +481,7 @@ src/libstddjb/selfpipe_trap.o src/libstddjb/selfpipe_trap.lo: src/libstddjb/self src/libstddjb/selfpipe_trapset.o src/libstddjb/selfpipe_trapset.lo: src/libstddjb/selfpipe_trapset.c src/include/skalibs/bsdsnowflake.h src/include/skalibs/nonposix.h src/include/skalibs/nsig.h src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h src/libstddjb/sgetopt.o src/libstddjb/sgetopt.lo: src/libstddjb/sgetopt.c src/include/skalibs/buffer.h src/include/skalibs/sgetopt.h src/libstddjb/sig0_scan.o src/libstddjb/sig0_scan.lo: src/libstddjb/sig0_scan.c src/include/skalibs/sig.h src/include/skalibs/types.h +src/libstddjb/sig_altignore.o src/libstddjb/sig_altignore.lo: src/libstddjb/sig_altignore.c src/include/skalibs/sig.h src/libstddjb/sig_block.o src/libstddjb/sig_block.lo: src/libstddjb/sig_block.c src/include/skalibs/sig.h src/libstddjb/sig_blocknone.o src/libstddjb/sig_blocknone.lo: src/libstddjb/sig_blocknone.c src/include/skalibs/sig.h src/libstddjb/sig_catch.o src/libstddjb/sig_catch.lo: src/libstddjb/sig_catch.c src/include/skalibs/functypes.h src/include/skalibs/sig.h diff --git 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 @@ -0,0 +1,15 @@ +/* ISC license. */ + +/* MT-unsafe */ + +#include <skalibs/sig.h> + +static void sig_nop (int sig) +{ + (void)sig ; +} + +int sig_altignore (int sig) +{ + return sig_catch(sig, &sig_nop) ; +}