From 265c5991afde5b64bf895f3a561c23f64ae4a5f9 Mon Sep 17 00:00:00 2001 From: gfleury Date: Fri, 3 Jan 2025 12:37:49 +0200 Subject: [PATCH] htl: move pthread_mutex_consistent, pthread_mutex_consistent_np into libc. Message-ID: <20250103103750.870897-6-gfleury@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 5 +++-- sysdeps/htl/pthreadP.h | 2 ++ sysdeps/mach/hurd/htl/pt-mutex-consistent.c | 13 ++++++++++--- sysdeps/mach/hurd/i386/libc.abilist | 4 ++++ sysdeps/mach/hurd/i386/libpthread.abilist | 2 -- sysdeps/mach/hurd/x86_64/libc.abilist | 4 ++++ sysdeps/mach/hurd/x86_64/libpthread.abilist | 2 -- 8 files changed, 24 insertions(+), 10 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index f6abd95772..5b0b6023b0 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -55,7 +55,6 @@ libpthread-routines := \ pt-testcancel \ pt-cancel \ pt-mutex-transfer-np \ - pt-mutex-consistent \ pt-rwlock-attr \ pt-rwlockattr-init \ pt-rwlockattr-destroy \ @@ -181,6 +180,7 @@ routines := \ pt-condattr-setpshared \ pt-getschedparam \ pt-mutex-checklocked \ + pt-mutex-consistent \ pt-mutex-destroy \ pt-mutex-getprioceiling \ pt-mutex-init \ diff --git a/htl/Versions b/htl/Versions index 9cd9f5a937..2ebf554cfa 100644 --- a/htl/Versions +++ b/htl/Versions @@ -89,6 +89,8 @@ libc { pthread_mutex_clocklock; + pthread_mutex_consistent; pthread_mutex_consistent_np; + pthread_mutexattr_getrobust; pthread_mutexattr_getrobust_np; pthread_mutexattr_setrobust; pthread_mutexattr_setrobust_np; } @@ -120,6 +122,7 @@ libc { } GLIBC_2.42 { + pthread_mutex_consistent; pthread_mutex_consistent_np; pthread_mutex_getprioceiling; pthread_mutex_setprioceiling; pthread_mutex_trylock; @@ -257,8 +260,6 @@ libpthread { cnd_broadcast; cnd_destroy; cnd_init; cnd_signal; cnd_timedwait; cnd_wait; tss_create; tss_delete; tss_get; tss_set; - pthread_mutex_consistent; pthread_mutex_consistent_np; - pthread_rwlock_clockrdlock; pthread_rwlock_clockwrlock; pthread_tryjoin_np; pthread_timedjoin_np; pthread_clockjoin_np; diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index f8aab6af9e..c39c7f117b 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -36,6 +36,8 @@ libc_hidden_proto (__pthread_mutex_init) extern int __pthread_mutex_clocklock (pthread_mutex_t *__mutex, clockid_t __clockid, const struct timespec *__abstime); libc_hidden_proto (__pthread_mutex_clocklock) +extern int __pthread_mutex_consistent (pthread_mutex_t *__mtxp); +libc_hidden_proto (__pthread_mutex_consistent) extern int __pthread_mutex_lock (pthread_mutex_t *__mutex); libc_hidden_proto (__pthread_mutex_lock) extern int __pthread_mutex_getprioceiling (const pthread_mutex_t *__mutex, diff --git a/sysdeps/mach/hurd/htl/pt-mutex-consistent.c b/sysdeps/mach/hurd/htl/pt-mutex-consistent.c index ab9edd8a1c..5aa75d15bd 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-consistent.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-consistent.c @@ -16,16 +16,17 @@ License along with the GNU C Library; if not, see . */ -#include +#include #include #include #include #include "pt-mutex.h" #include #include +#include int -pthread_mutex_consistent (pthread_mutex_t *mtxp) +__pthread_mutex_consistent (pthread_mutex_t *mtxp) { int ret = EINVAL; unsigned int val = mtxp->__lock; @@ -44,5 +45,11 @@ pthread_mutex_consistent (pthread_mutex_t *mtxp) return ret; } +libc_hidden_def (__pthread_mutex_consistent) +versioned_symbol (libc, __pthread_mutex_consistent, pthread_mutex_consistent, GLIBC_2_42); +versioned_symbol (libc, __pthread_mutex_consistent, pthread_mutex_consistent_np, GLIBC_2_42); -weak_alias (pthread_mutex_consistent, pthread_mutex_consistent_np) +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_32, GLIBC_2_42) +compat_symbol (libpthread, __pthread_mutex_consistent,pthread_mutex_consistent, GLIBC_2_32); +compat_symbol (libpthread, __pthread_mutex_consistent,pthread_mutex_consistent_np, GLIBC_2_32); +#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index f153f475c3..17656eb119 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -2272,6 +2272,8 @@ GLIBC_2.32 mach_print F GLIBC_2.32 mremap F GLIBC_2.32 pthread_cond_clockwait F GLIBC_2.32 pthread_mutex_clocklock F +GLIBC_2.32 pthread_mutex_consistent F +GLIBC_2.32 pthread_mutex_consistent_np F GLIBC_2.32 pthread_mutexattr_getrobust F GLIBC_2.32 pthread_mutexattr_getrobust_np F GLIBC_2.32 pthread_mutexattr_setrobust F @@ -2557,6 +2559,8 @@ GLIBC_2.41 pthread_mutexattr_setrobust F GLIBC_2.41 pthread_mutexattr_setrobust_np F GLIBC_2.41 pthread_mutexattr_settype F GLIBC_2.41 pthread_sigmask F +GLIBC_2.42 pthread_mutex_consistent F +GLIBC_2.42 pthread_mutex_consistent_np F GLIBC_2.42 pthread_mutex_getprioceiling F GLIBC_2.42 pthread_mutex_setprioceiling F GLIBC_2.42 pthread_mutex_trylock F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 53b433c725..0877c0a84b 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -99,8 +99,6 @@ GLIBC_2.32 mtx_timedlock F GLIBC_2.32 mtx_trylock F GLIBC_2.32 mtx_unlock F GLIBC_2.32 pthread_clockjoin_np F -GLIBC_2.32 pthread_mutex_consistent F -GLIBC_2.32 pthread_mutex_consistent_np F GLIBC_2.32 pthread_rwlock_clockrdlock F GLIBC_2.32 pthread_rwlock_clockwrlock F GLIBC_2.32 pthread_timedjoin_np F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index bdb89fb41d..4f7ba3a700 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1548,6 +1548,8 @@ GLIBC_2.38 pthread_equal F GLIBC_2.38 pthread_exit F GLIBC_2.38 pthread_getschedparam F GLIBC_2.38 pthread_mutex_clocklock F +GLIBC_2.38 pthread_mutex_consistent F +GLIBC_2.38 pthread_mutex_consistent_np F GLIBC_2.38 pthread_mutex_destroy F GLIBC_2.38 pthread_mutex_getprioceiling F GLIBC_2.38 pthread_mutex_init F @@ -2242,6 +2244,8 @@ GLIBC_2.41 pthread_mutexattr_setrobust F GLIBC_2.41 pthread_mutexattr_setrobust_np F GLIBC_2.41 pthread_mutexattr_settype F GLIBC_2.41 pthread_sigmask F +GLIBC_2.42 pthread_mutex_consistent F +GLIBC_2.42 pthread_mutex_consistent_np F GLIBC_2.42 pthread_mutex_getprioceiling F GLIBC_2.42 pthread_mutex_setprioceiling F GLIBC_2.42 pthread_mutex_trylock F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 5f0f73d10f..f4cee89580 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -61,8 +61,6 @@ GLIBC_2.38 pthread_join F GLIBC_2.38 pthread_key_create F GLIBC_2.38 pthread_key_delete F GLIBC_2.38 pthread_kill F -GLIBC_2.38 pthread_mutex_consistent F -GLIBC_2.38 pthread_mutex_consistent_np F GLIBC_2.38 pthread_mutex_transfer_np F GLIBC_2.38 pthread_once F GLIBC_2.38 pthread_rwlock_clockrdlock F