@@ -58,6 +58,18 @@ static const sigset_t sigall_set = {
.__val = {[0 ... _SIGSET_NWORDS-1 ] = -1 }
};
+static const sigset_t sigapp_set = {
+#if ULONG_MAX == 0xffffffff
+ .__val = { [0] = ~0UL & ~(__sigmask (SIGCANCEL)),
+ [1] = ~0UL & ~(__sigmask (SIGSETXID)),
+ [2 ... _SIGSET_NWORDS-1] = ~0UL }
+#else
+ .__val = { [0] = ~0UL & ~(__sigmask (SIGCANCEL)
+ | __sigmask (SIGSETXID)),
+ [1 ... _SIGSET_NWORDS-1] = ~0UL }
+#endif
+};
+
/* Block all signals, including internal glibc ones. */
static inline int
__libc_signal_block_all (sigset_t *set)
@@ -71,10 +83,8 @@ __libc_signal_block_all (sigset_t *set)
static inline int
__libc_signal_block_app (sigset_t *set)
{
- sigset_t allset = sigall_set;
- __clear_internal_signals (&allset);
INTERNAL_SYSCALL_DECL (err);
- return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_BLOCK, &allset,
+ return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_BLOCK, &sigapp_set,
set, _NSIG / 8);
}