aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgfleury <gfleury@disroot.org>2024-12-13 00:06:12 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-12-14 23:13:14 +0100
commit2716bd6b128b05f0bfc5a58f03159a49320b2ab2 (patch)
tree2684f612b7f7e98369c10366ec4438c3e245ffd9
parent79cb83c7f9d648c214e4c61fe5bd1c376b38e723 (diff)
downloadglibc-2716bd6b128b05f0bfc5a58f03159a49320b2ab2.zip
glibc-2716bd6b128b05f0bfc5a58f03159a49320b2ab2.tar.gz
glibc-2716bd6b128b05f0bfc5a58f03159a49320b2ab2.tar.bz2
htl: move pthread_sigmask into libc.
Message-ID: <20241212220612.782313-3-gfleury@disroot.org>
-rw-r--r--htl/Makefile2
-rw-r--r--htl/Versions4
-rw-r--r--htl/pt-sigmask.c10
-rw-r--r--sysdeps/htl/pthreadP.h2
-rw-r--r--sysdeps/htl/timer_routines.c6
-rw-r--r--sysdeps/mach/hurd/gai_misc.h8
-rw-r--r--sysdeps/mach/hurd/i386/libc.abilist2
-rw-r--r--sysdeps/mach/hurd/i386/libpthread.abilist1
-rw-r--r--sysdeps/mach/hurd/x86_64/libc.abilist2
-rw-r--r--sysdeps/mach/hurd/x86_64/libpthread.abilist1
10 files changed, 25 insertions, 13 deletions
diff --git a/htl/Makefile b/htl/Makefile
index 2e14f12..7f40fd9 100644
--- a/htl/Makefile
+++ b/htl/Makefile
@@ -48,7 +48,6 @@ libpthread-routines := \
pt-exit \
pt-initialize \
pt-join \
- pt-sigmask \
pt-spin-inlines \
pt-cleanup \
pt-setcancelstate \
@@ -209,6 +208,7 @@ routines := \
pt-pthread_self \
pt-self pt-equal \
pt-setschedparam \
+ pt-sigmask \
pt-sigstate \
pt-sigstate-destroy \
# routines
diff --git a/htl/Versions b/htl/Versions
index 5ea9887..dd786f7 100644
--- a/htl/Versions
+++ b/htl/Versions
@@ -32,6 +32,7 @@ libc {
pthread_condattr_getpshared;
pthread_condattr_setclock;
pthread_condattr_setpshared;
+ pthread_sigmask;
}
GLIBC_2.21 {
@@ -74,6 +75,7 @@ libc {
pthread_condattr_getpshared;
pthread_condattr_setclock;
pthread_condattr_setpshared;
+ pthread_sigmask;
}
@@ -96,6 +98,7 @@ libc {
__pthread_default_condattr;
__pthread_sigstate;
__pthread_sigstate_destroy;
+ __pthread_sigmask;
}
}
@@ -173,7 +176,6 @@ libpthread {
pthread_setconcurrency;
pthread_setschedprio; pthread_setspecific;
- pthread_sigmask;
pthread_testcancel;
pthread_yield;
diff --git a/htl/pt-sigmask.c b/htl/pt-sigmask.c
index 81ec6b0..2405cbe 100644
--- a/htl/pt-sigmask.c
+++ b/htl/pt-sigmask.c
@@ -18,14 +18,20 @@
#include <pthread.h>
#include <signal.h>
-
+#include <shlib-compat.h>
#include <pt-internal.h>
int
-pthread_sigmask (int how, const sigset_t *set, sigset_t *oset)
+__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);
}
+libc_hidden_def (__pthread_sigmask)
+versioned_symbol (libc, __pthread_sigmask, pthread_sigmask, GLIBC_2_41);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_41)
+compat_symbol (libpthread, __pthread_sigmask, pthread_sigmask, GLIBC_2_12);
+#endif
diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h
index afdf2cb..adb81bc 100644
--- a/sysdeps/htl/pthreadP.h
+++ b/sysdeps/htl/pthreadP.h
@@ -55,6 +55,8 @@ extern int __pthread_cond_clockwait (pthread_cond_t *cond,
const struct timespec *abstime)
__nonnull ((1, 2, 4));
extern int __pthread_cond_destroy (pthread_cond_t *cond);
+extern int __pthread_sigmask (int, const sigset_t *, sigset_t *);
+libc_hidden_proto (__pthread_sigmask);
typedef struct __cthread *__cthread_t;
typedef int __cthread_key_t;
diff --git a/sysdeps/htl/timer_routines.c b/sysdeps/htl/timer_routines.c
index 857b1cb..3a63de6 100644
--- a/sysdeps/htl/timer_routines.c
+++ b/sysdeps/htl/timer_routines.c
@@ -18,7 +18,7 @@
#include <assert.h>
#include <errno.h>
-#include <pthread.h>
+#include <pthreadP.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
@@ -468,7 +468,7 @@ __timer_thread_start (struct thread_node *thread)
thread->exists = 1;
sigfillset (&set);
- pthread_sigmask (SIG_SETMASK, &set, &oset);
+ __pthread_sigmask (SIG_SETMASK, &set, &oset);
if (pthread_create (&thread->id, &thread->attr,
(void *(*) (void *)) thread_func, thread) != 0)
@@ -477,7 +477,7 @@ __timer_thread_start (struct thread_node *thread)
retval = -1;
}
- pthread_sigmask (SIG_SETMASK, &oset, NULL);
+ __pthread_sigmask (SIG_SETMASK, &oset, NULL);
return retval;
}
diff --git a/sysdeps/mach/hurd/gai_misc.h b/sysdeps/mach/hurd/gai_misc.h
index bd26ec3..d822509 100644
--- a/sysdeps/mach/hurd/gai_misc.h
+++ b/sysdeps/mach/hurd/gai_misc.h
@@ -17,7 +17,7 @@
#include <assert.h>
#include <signal.h>
-#include <pthread.h>
+#include <pthreadP.h>
#define gai_start_notify_thread __gai_start_notify_thread
#define gai_create_helper_thread __gai_create_helper_thread
@@ -28,7 +28,7 @@ __gai_start_notify_thread (void)
sigset_t ss;
sigemptyset (&ss);
int sigerr __attribute__ ((unused));
- sigerr = pthread_sigmask (SIG_SETMASK, &ss, NULL);
+ sigerr = __pthread_sigmask (SIG_SETMASK, &ss, NULL);
assert_perror (sigerr);
}
@@ -51,13 +51,13 @@ __gai_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
sigset_t oss;
sigfillset (&ss);
int sigerr __attribute__ ((unused));
- sigerr = pthread_sigmask (SIG_SETMASK, &ss, &oss);
+ sigerr = __pthread_sigmask (SIG_SETMASK, &ss, &oss);
assert_perror (sigerr);
int ret = pthread_create (threadp, &attr, tf, arg);
/* Restore the signal mask. */
- sigerr = pthread_sigmask (SIG_SETMASK, &oss, NULL);
+ sigerr = __pthread_sigmask (SIG_SETMASK, &oss, NULL);
assert_perror (sigerr);
(void) pthread_attr_destroy (&attr);
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index 76ded62..f4613aa 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -59,6 +59,7 @@ GLIBC_2.12 pthread_equal F
GLIBC_2.12 pthread_getschedparam F
GLIBC_2.12 pthread_self F
GLIBC_2.12 pthread_setschedparam F
+GLIBC_2.12 pthread_sigmask F
GLIBC_2.13 __fentry__ F
GLIBC_2.14 syncfs F
GLIBC_2.15 __fdelt_chk F
@@ -2513,6 +2514,7 @@ GLIBC_2.41 pthread_condattr_getclock F
GLIBC_2.41 pthread_condattr_getpshared F
GLIBC_2.41 pthread_condattr_setclock F
GLIBC_2.41 pthread_condattr_setpshared F
+GLIBC_2.41 pthread_sigmask F
GLIBC_2.5 __readlinkat_chk F
GLIBC_2.5 inet6_opt_append F
GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist
index 72cb549..e5b3edb 100644
--- a/sysdeps/mach/hurd/i386/libpthread.abilist
+++ b/sysdeps/mach/hurd/i386/libpthread.abilist
@@ -85,7 +85,6 @@ GLIBC_2.12 pthread_setcanceltype F
GLIBC_2.12 pthread_setconcurrency F
GLIBC_2.12 pthread_setschedprio F
GLIBC_2.12 pthread_setspecific F
-GLIBC_2.12 pthread_sigmask F
GLIBC_2.12 pthread_spin_destroy F
GLIBC_2.12 pthread_spin_init F
GLIBC_2.12 pthread_spin_lock F
diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist
index c2ee0b1..b331c26 100644
--- a/sysdeps/mach/hurd/x86_64/libc.abilist
+++ b/sysdeps/mach/hurd/x86_64/libc.abilist
@@ -1554,6 +1554,7 @@ GLIBC_2.38 pthread_self F
GLIBC_2.38 pthread_setcancelstate F
GLIBC_2.38 pthread_setcanceltype F
GLIBC_2.38 pthread_setschedparam F
+GLIBC_2.38 pthread_sigmask F
GLIBC_2.38 ptrace F
GLIBC_2.38 ptsname F
GLIBC_2.38 ptsname_r F
@@ -2208,6 +2209,7 @@ GLIBC_2.41 pthread_condattr_getclock F
GLIBC_2.41 pthread_condattr_getpshared F
GLIBC_2.41 pthread_condattr_setclock F
GLIBC_2.41 pthread_condattr_setpshared F
+GLIBC_2.41 pthread_sigmask F
HURD_CTHREADS_0.3 __cthread_getspecific F
HURD_CTHREADS_0.3 __cthread_keycreate F
HURD_CTHREADS_0.3 __cthread_setspecific F
diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist
index bdadfd7..89a6304 100644
--- a/sysdeps/mach/hurd/x86_64/libpthread.abilist
+++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist
@@ -115,7 +115,6 @@ GLIBC_2.38 pthread_setcanceltype F
GLIBC_2.38 pthread_setconcurrency F
GLIBC_2.38 pthread_setschedprio F
GLIBC_2.38 pthread_setspecific F
-GLIBC_2.38 pthread_sigmask F
GLIBC_2.38 pthread_spin_destroy F
GLIBC_2.38 pthread_spin_init F
GLIBC_2.38 pthread_spin_lock F