summaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_sigsuspend.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpthread/thread/thr_sigsuspend.c')
-rw-r--r--lib/libpthread/thread/thr_sigsuspend.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libpthread/thread/thr_sigsuspend.c b/lib/libpthread/thread/thr_sigsuspend.c
index 869e3d919bab5..e3402a468a6ef 100644
--- a/lib/libpthread/thread/thr_sigsuspend.c
+++ b/lib/libpthread/thread/thr_sigsuspend.c
@@ -35,6 +35,7 @@
#include <errno.h>
#include <pthread.h>
#include <string.h>
+#include <sys/signalvar.h>
#include "thr_private.h"
__weak_reference(__sigsuspend, sigsuspend);
@@ -46,12 +47,14 @@ _sigsuspend(const sigset_t *set)
sigset_t oldmask, newmask;
int ret = -1;
- if (!_kse_isthreaded())
- return __sys_sigsuspend(set);
+ if (!_kse_isthreaded() ||
+ (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM))
+ return (__sys_sigsuspend(set));
/* Check if a new signal set was provided by the caller: */
if (set != NULL) {
newmask = *set;
+ SIG_CANTMASK(newmask);
THR_LOCK_SWITCH(curthread);