+# ifdef _LIBC
+/* It's far too much PITA to __USE_EXTERN_INLINES from within libc.
+ * Especially since we want to inline only calls with const sig,
+ * but __USE_EXTERN_INLINES will inline all calls!
+ */
+static __always_inline unsigned long
+const_sigismember(const __sigset_t *set, int sig)
+{
+ unsigned long mask = __sigmask(sig);
+ unsigned word = __sigword(sig);
+ return (set->__val[word] & mask);
+}
+# define __sigismember(set, sig) \
+ (__builtin_constant_p(sig) ? (const_sigismember(set, sig) != 0) : __sigismember(set, sig))
+static __always_inline void
+const_sigaddset(__sigset_t *set, int sig)
+{
+ unsigned long mask = __sigmask(sig);
+ unsigned word = __sigword(sig);
+ set->__val[word] |= mask;
+}
+# define __sigaddset(set, sig) \
+ (__builtin_constant_p(sig) ? const_sigaddset(set, sig) : __sigaddset(set, sig))
+static __always_inline void
+const_sigdelset(__sigset_t *set, int sig)
+{
+ unsigned long mask = __sigmask(sig);
+ unsigned word = __sigword(sig);
+ set->__val[word] &= ~mask;
+}
+# define __sigdelset(set, sig) \
+ (__builtin_constant_p(sig) ? const_sigdelset(set, sig) : __sigdelset(set, sig))
+# endif