summaryrefslogtreecommitdiffstats
path: root/libc/signal/sigpause.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2006-08-22 02:18:42 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2006-08-22 02:18:42 +0000
commit92aa0ba401b0f8c37a27e49472588b13c01850d4 (patch)
tree038fb21a32ad51b294daf6446e7f83360153729e /libc/signal/sigpause.c
parent5d3eef53f208af68e3816850d8505ccb06cfe35a (diff)
downloaduClibc-alpine-92aa0ba401b0f8c37a27e49472588b13c01850d4.tar.bz2
uClibc-alpine-92aa0ba401b0f8c37a27e49472588b13c01850d4.tar.xz
Changes for NPTL.
Diffstat (limited to 'libc/signal/sigpause.c')
-rw-r--r--libc/signal/sigpause.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libc/signal/sigpause.c b/libc/signal/sigpause.c
index 8c99af0a1..ffb3595fb 100644
--- a/libc/signal/sigpause.c
+++ b/libc/signal/sigpause.c
@@ -23,6 +23,9 @@
#define __FAVOR_BSD
#include <signal.h>
#include <stddef.h> /* For NULL. */
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+#endif
libc_hidden_proto(sigprocmask)
libc_hidden_proto(sigdelset)
@@ -48,6 +51,9 @@ int __sigpause (int sig_or_mask, int is_sig)
else if (sigset_set_old_mask (&set, sig_or_mask) < 0)
return -1;
+ /* Note the sigpause() is a cancellation point. But since we call
+ sigsuspend() which itself is a cancellation point we do not have
+ to do anything here. */
return sigsuspend (&set);
}
libc_hidden_def(__sigpause)
@@ -60,6 +66,19 @@ libc_hidden_def(__sigpause)
libc_hidden_proto(sigpause)
int sigpause (int mask)
{
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+ if (SINGLE_THREAD_P)
+ return __sigpause (mask, 0);
+
+ int oldtype = LIBC_CANCEL_ASYNC ();
+
+ int result = __sigpause (mask, 0);
+
+ LIBC_CANCEL_RESET (oldtype);
+
+ return result;
+#else
return __sigpause (mask, 0);
+#endif
}
libc_hidden_def(sigpause)