aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2025-03-06 00:14:06 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-03-06 02:28:35 +0100
commit81c4ec1ca8c5c4030c1784a098091b6308f98595 (patch)
treeabd3f3290400711176afb39e936451ef99c4073d
parent7a185eb9e944553fb5f8ce8491e1f8569f2f4aa0 (diff)
downloadglibc-81c4ec1ca8c5c4030c1784a098091b6308f98595.zip
glibc-81c4ec1ca8c5c4030c1784a098091b6308f98595.tar.gz
glibc-81c4ec1ca8c5c4030c1784a098091b6308f98595.tar.bz2
htl: Make __pthread_sigmask directly call __sigthreadmask
If no thread was created yet, __pthread_sigstate will not find our ss because self->kernel_thread is still nul, and then change the global sigstate instead of our sigstate! We can directly call __sigthreadmask and skip the (bogus) lookup step.
-rw-r--r--htl/pt-sigmask.c5
-rw-r--r--sysdeps/mach/hurd/sigthreadmask.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/htl/pt-sigmask.c b/htl/pt-sigmask.c
index 7b2622c..e00a3fa 100644
--- a/htl/pt-sigmask.c
+++ b/htl/pt-sigmask.c
@@ -19,15 +19,14 @@
#include <pthread.h>
#include <signal.h>
#include <shlib-compat.h>
+#include <hurd/signal.h>
#include <pt-internal.h>
int
__pthread_sigmask (int how, const sigset_t *set, sigset_t *oset)
{
- struct __pthread *self = _pthread_self ();
-
/* Do not clear SELF's pending signals. */
- return __pthread_sigstate (self, how, set, oset, 0);
+ return __sigthreadmask (_hurd_self_sigstate (), how, set, oset, 0);
}
libc_hidden_def (__pthread_sigmask)
versioned_symbol (libc, __pthread_sigmask, pthread_sigmask, GLIBC_2_41);
diff --git a/sysdeps/mach/hurd/sigthreadmask.c b/sysdeps/mach/hurd/sigthreadmask.c
index d8e928b..9b4f530 100644
--- a/sysdeps/mach/hurd/sigthreadmask.c
+++ b/sysdeps/mach/hurd/sigthreadmask.c
@@ -36,6 +36,8 @@ __sigthreadmask (struct hurd_sigstate *ss, int how,
new = *set;
assert (ss);
+ /* We are not supposed to change the global blocked state */
+ assert (ss != _hurd_global_sigstate);
_hurd_sigstate_lock (ss);