summaryrefslogtreecommitdiffstats
path: root/libc/sysdeps/linux/common/sigprocmask.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2005-11-16 03:30:28 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2005-11-16 03:30:28 +0000
commit0fb4fc069a40cbc71ad6c5b6ca63d23eaa4f1996 (patch)
tree260d9f1a64486b2c2e6cf030c5493aab19b3722f /libc/sysdeps/linux/common/sigprocmask.c
parent8dfed73ce2ed96b42b6c79e6080216ef23be4828 (diff)
downloaduClibc-alpine-0fb4fc069a40cbc71ad6c5b6ca63d23eaa4f1996.tar.bz2
uClibc-alpine-0fb4fc069a40cbc71ad6c5b6ca63d23eaa4f1996.tar.xz
Update signal handlers for NPTL.
Diffstat (limited to 'libc/sysdeps/linux/common/sigprocmask.c')
-rw-r--r--libc/sysdeps/linux/common/sigprocmask.c50
1 files changed, 48 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/common/sigprocmask.c b/libc/sysdeps/linux/common/sigprocmask.c
index 70ff36606..3f42b09b8 100644
--- a/libc/sysdeps/linux/common/sigprocmask.c
+++ b/libc/sysdeps/linux/common/sigprocmask.c
@@ -18,8 +18,30 @@
_syscall4(int, __rt_sigprocmask, int, how, const sigset_t *, set,
sigset_t *, oldset, size_t, size);
-int sigprocmask(int how, const sigset_t * set, sigset_t * oldset)
+int __sigprocmask(int how, const sigset_t * set, sigset_t * oldset)
{
+#ifdef SIGCANCEL
+ sigset_t local_newmask;
+
+ /*
+ * The only thing we have to make sure here is that SIGCANCEL and
+ * SIGSETXID are not blocked.
+ */
+ if (set != NULL && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
+# ifdef SIGSETXID
+ || __builtin_expect (__sigismember (set, SIGSETXID), 0)
+# endif
+ ))
+ {
+ local_newmask = *set;
+ __sigdelset (&local_newmask, SIGCANCEL);
+# ifdef SIGSETXID
+ __sigdelset (&local_newmask, SIGSETXID);
+# endif
+ set = &local_newmask;
+ }
+#endif
+
if (set &&
#if (SIG_BLOCK == 0) && (SIG_UNBLOCK == 1) && (SIG_SETMASK == 2)
(((unsigned int) how) > 2)
@@ -43,8 +65,30 @@ static inline
_syscall3(int, __syscall_sigprocmask, int, how, const sigset_t *, set,
sigset_t *, oldset);
-int sigprocmask(int how, const sigset_t * set, sigset_t * oldset)
+int __sigprocmask(int how, const sigset_t * set, sigset_t * oldset)
{
+#ifdef SIGCANCEL
+ sigset_t local_newmask;
+
+ /*
+ * The only thing we have to make sure here is that SIGCANCEL and
+ * SIGSETXID are not blocked.
+ */
+ if (set != NULL && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
+# ifdef SIGSETXID
+ || __builtin_expect (__sigismember (set, SIGSETXID), 0)
+# endif
+ ))
+ {
+ local_newmask = *set;
+ __sigdelset (&local_newmask, SIGCANCEL);
+# ifdef SIGSETXID
+ __sigdelset (&local_newmask, SIGSETXID);
+# endif
+ set = &local_newmask;
+ }
+#endif
+
if (set &&
#if (SIG_BLOCK == 0) && (SIG_UNBLOCK == 1) && (SIG_SETMASK == 2)
(((unsigned int) how) > 2)
@@ -60,3 +104,5 @@ int sigprocmask(int how, const sigset_t * set, sigset_t * oldset)
return (__syscall_sigprocmask(how, set, oldset));
}
#endif
+
+weak_alias (__sigprocmask, sigprocmask)