]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
htl: move sem_{clockwait, timedwait, wait, trywait} into libc.
authorgfleury <gfleury@disroot.org>
Sun, 17 Aug 2025 10:40:21 +0000 (12:40 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 17 Aug 2025 23:06:38 +0000 (01:06 +0200)
Message-ID: <20250817104023.91919-7-gfleury@disroot.org>

12 files changed:
htl/Makefile
htl/Versions
hurd/hurdlock.c
hurd/hurdlock.h
sysdeps/htl/include/semaphore.h
sysdeps/htl/sem-timedwait.c
sysdeps/htl/sem-trywait.c
sysdeps/htl/sem-wait.c
sysdeps/mach/hurd/i386/libc.abilist
sysdeps/mach/hurd/i386/libpthread.abilist
sysdeps/mach/hurd/x86_64/libc.abilist
sysdeps/mach/hurd/x86_64/libpthread.abilist

index b995d1a4b3d272182fc6136032e0979f40243b6c..56b29e6bfd8e0b2e271f9f2f1fc8160201e12420 100644 (file)
@@ -34,11 +34,7 @@ libpthread-routines := \
   pt-spin \
   pt-getname-np \
   pt-setname-np \
-  sem-timedwait \
-  sem-trywait \
   sem_unlink \
-  sem-wait \
-  sem-waitfast \
   cancellation \
   cthreads-compat \
   herrno \
@@ -208,6 +204,10 @@ routines := \
   sem-getvalue \
   sem-init \
   sem-post \
+  sem-timedwait \
+  sem-trywait \
+  sem-wait \
+  sem-waitfast \
   sem_close \
   sem_open \
   sem_routines \
index ff1d5b934899ad02426bc4ffe55c5628856cc325..c22b1b07f3a92e2ce702bb048e331b28331219b4 100644 (file)
@@ -107,6 +107,9 @@ libc {
     sem_init;
     sem_open;
     sem_post;
+    sem_timedwait;
+    sem_trywait;
+    sem_wait;
   }
 
   GLIBC_2.21 {
@@ -147,6 +150,8 @@ libc {
 
     pthread_rwlock_clockrdlock; pthread_rwlock_clockwrlock;
     pthread_timedjoin_np; pthread_tryjoin_np;
+
+    sem_clockwait;
   }
 
   GLIBC_2.41 {
@@ -225,12 +230,16 @@ libc {
     pthread_timedjoin_np;
     pthread_tryjoin_np;
     pthread_yield;
+    sem_clockwait;
     sem_close;
     sem_destroy;
     sem_getvalue;
     sem_init;
     sem_open;
     sem_post;
+    sem_timedwait;
+    sem_trywait;
+    sem_wait;
   }
 
   GLIBC_PRIVATE {
@@ -323,7 +332,7 @@ libpthread {
 
     pthread_create;
 
-    sem_timedwait; sem_trywait; sem_unlink; sem_wait;
+    sem_unlink;
 
     pthread_spin_destroy; pthread_spin_init; pthread_spin_lock;
     pthread_spin_trylock; pthread_spin_unlock;
@@ -343,8 +352,6 @@ libpthread {
     call_once;
     cnd_broadcast; cnd_destroy; cnd_init; cnd_signal; cnd_timedwait; cnd_wait;
     tss_create; tss_delete; tss_get; tss_set;
-
-    sem_clockwait;
   }
 
   GLIBC_2.40 {
index c771662e84100676eb29f7d20b955478760ba6f1..1cb6981ac2aa9e232ac3c8cdd4d886a46d33ad54 100644 (file)
@@ -64,6 +64,7 @@ __lll_abstimed_wait_intr (void *ptr, int val,
   int mlsec = compute_reltime (tsp, clk);
   return mlsec < 0 ? KERN_TIMEDOUT : __lll_timed_wait_intr (ptr, val, mlsec, flags);
 }
+libc_hidden_def (__lll_abstimed_wait_intr)
 
 int
 __lll_abstimed_xwait (void *ptr, int lo, int hi,
index 0cfccc562c5611192d7cf8ffbc3b586842d12299..532a07d5f4d88b047d401542fb7b64cb476a779b 100644 (file)
@@ -58,6 +58,7 @@ extern int __lll_abstimed_wait (void *__ptr, int __val,
 /* Interruptible version.  */
 extern int __lll_abstimed_wait_intr (void *__ptr, int __val,
   const struct timespec *__tsp, int __flags, int __clk);
+libc_hidden_proto (__lll_abstimed_wait_intr)
 
 /* Same as 'lll_xwait', but only block until TSP elapses,
    using clock CLK.  */
index 5e5d3c18e913316188ec62d77494c8886a640839..b91b9b70772b13419a5066182d8105a02e157fe1 100644 (file)
@@ -4,6 +4,17 @@
 #ifndef _ISOMAC
 extern __typeof (sem_post) __sem_post;
 libc_hidden_proto (__sem_post)
+
+extern int __sem_clockwait (sem_t *__sem,
+                         clockid_t clock,
+                         const struct timespec *__abstime);
+libc_hidden_proto (__sem_clockwait)
+extern int __sem_timedwait (sem_t *__sem,
+                         const struct timespec *__abstime);
+libc_hidden_proto (__sem_timedwait)
+
+extern int __sem_trywait (sem_t *__sem);
+libc_hidden_proto (__sem_trywait)
 #endif
 
 #endif
index 4931dde5ced453d7f59162fc9b128357b7405bc7..8f2b4d3f8b7ba5475ee7030bc2babf5514ee2125 100644 (file)
@@ -25,6 +25,7 @@
 #include <sysdep-cancel.h>
 
 #include <pt-internal.h>
+#include <shlib-compat.h>
 
 #if !__HAVE_64B_ATOMICS
 static void
@@ -196,7 +197,12 @@ __sem_clockwait (sem_t *sem, clockid_t clockid,
 {
   return __sem_timedwait_internal (sem, clockid, timeout);
 }
-weak_alias (__sem_clockwait, sem_clockwait);
+
+libc_hidden_def (__sem_clockwait)
+versioned_symbol (libc, __sem_clockwait, sem_clockwait, GLIBC_2_43);
+# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_32, GLIBC_2_43)
+compat_symbol (libpthread, __sem_clockwait, sem_clockwait, GLIBC_2_32);
+#endif
 
 int
 __sem_timedwait (sem_t *restrict sem, const struct timespec *restrict timeout)
@@ -204,4 +210,8 @@ __sem_timedwait (sem_t *restrict sem, const struct timespec *restrict timeout)
   return __sem_timedwait_internal (sem, CLOCK_REALTIME, timeout);
 }
 
-weak_alias (__sem_timedwait, sem_timedwait);
+libc_hidden_def (__sem_timedwait)
+versioned_symbol (libc, __sem_timedwait, sem_timedwait, GLIBC_2_43);
+# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43)
+compat_symbol (libpthread, __sem_timedwait, sem_timedwait, GLIBC_2_12);
+#endif
index 38846bf9a36332f3b1d039fabf1d51c6f8c715f9..0d1e9cd5a8d00907549ded2f423c0a5132f3fddf 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <hurd.h>
 #include <pt-internal.h>
+#include <shlib-compat.h>
 
 int
 __sem_trywait (sem_t *sem)
@@ -33,4 +34,8 @@ __sem_trywait (sem_t *sem)
   return __hurd_fail (EAGAIN);
 }
 
-weak_alias (__sem_trywait, sem_trywait);
+libc_hidden_def (__sem_trywait)
+versioned_symbol (libc, __sem_trywait, sem_trywait, GLIBC_2_43);
+# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43)
+compat_symbol (libpthread, __sem_trywait, sem_trywait, GLIBC_2_12);
+#endif
index 97c873dc8d1d592b8de798c3f57f19d8243b2d63..c2fc7a93f14bf6bff4df4f00f7bcb8970a03489e 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <semaphore.h>
 #include <pt-internal.h>
+#include <shlib-compat.h>
 
 extern int __sem_timedwait_internal (sem_t *restrict sem,
                                     clockid_t clockid,
@@ -29,4 +30,7 @@ __sem_wait (sem_t *sem)
   return __sem_timedwait_internal (sem, CLOCK_REALTIME, 0);
 }
 
-strong_alias (__sem_wait, sem_wait);
+versioned_symbol (libc, __sem_wait, sem_wait, GLIBC_2_43);
+# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43)
+compat_symbol (libpthread, __sem_wait, sem_wait, GLIBC_2_12);
+#endif
index 661bbf953238f0af4a98ec192aaf43e922670ad9..8eabddcec6e13f634cf90d361139cfb25c289dd4 100644 (file)
@@ -134,6 +134,9 @@ GLIBC_2.12 sem_getvalue F
 GLIBC_2.12 sem_init F
 GLIBC_2.12 sem_open F
 GLIBC_2.12 sem_post F
+GLIBC_2.12 sem_timedwait F
+GLIBC_2.12 sem_trywait F
+GLIBC_2.12 sem_wait F
 GLIBC_2.13 __fentry__ F
 GLIBC_2.14 syncfs F
 GLIBC_2.15 __fdelt_chk F
@@ -2333,6 +2336,7 @@ GLIBC_2.32 pthread_rwlock_clockrdlock F
 GLIBC_2.32 pthread_rwlock_clockwrlock F
 GLIBC_2.32 pthread_timedjoin_np F
 GLIBC_2.32 pthread_tryjoin_np F
+GLIBC_2.32 sem_clockwait F
 GLIBC_2.32 sigabbrev_np F
 GLIBC_2.32 sigdescr_np F
 GLIBC_2.32 strerrordesc_np F
@@ -2672,12 +2676,16 @@ GLIBC_2.43 pthread_testcancel F
 GLIBC_2.43 pthread_timedjoin_np F
 GLIBC_2.43 pthread_tryjoin_np F
 GLIBC_2.43 pthread_yield F
+GLIBC_2.43 sem_clockwait F
 GLIBC_2.43 sem_close F
 GLIBC_2.43 sem_destroy F
 GLIBC_2.43 sem_getvalue F
 GLIBC_2.43 sem_init F
 GLIBC_2.43 sem_open F
 GLIBC_2.43 sem_post F
+GLIBC_2.43 sem_timedwait F
+GLIBC_2.43 sem_trywait F
+GLIBC_2.43 sem_wait F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
index 07dd75378e9baaa47da3911343a02695e4a7fcac..483d7927277d6957aca1c7e29cb28758406f825f 100644 (file)
@@ -24,10 +24,7 @@ GLIBC_2.12 pthread_spin_init F
 GLIBC_2.12 pthread_spin_lock F
 GLIBC_2.12 pthread_spin_trylock F
 GLIBC_2.12 pthread_spin_unlock F
-GLIBC_2.12 sem_timedwait F
-GLIBC_2.12 sem_trywait F
 GLIBC_2.12 sem_unlink F
-GLIBC_2.12 sem_wait F
 GLIBC_2.2.6 _IO_flockfile F
 GLIBC_2.2.6 _IO_ftrylockfile F
 GLIBC_2.2.6 _IO_funlockfile F
@@ -48,7 +45,6 @@ GLIBC_2.32 mtx_lock F
 GLIBC_2.32 mtx_timedlock F
 GLIBC_2.32 mtx_trylock F
 GLIBC_2.32 mtx_unlock F
-GLIBC_2.32 sem_clockwait F
 GLIBC_2.32 thrd_create F
 GLIBC_2.32 thrd_detach F
 GLIBC_2.32 thrd_exit F
index 6fa0e6f01a7ccec8e374fed442a442590993bbf3..de42acab3de4023d54e3750c965b2cf4a3b07ce4 100644 (file)
@@ -1759,12 +1759,16 @@ GLIBC_2.38 seed48 F
 GLIBC_2.38 seed48_r F
 GLIBC_2.38 seekdir F
 GLIBC_2.38 select F
+GLIBC_2.38 sem_clockwait F
 GLIBC_2.38 sem_close F
 GLIBC_2.38 sem_destroy F
 GLIBC_2.38 sem_getvalue F
 GLIBC_2.38 sem_init F
 GLIBC_2.38 sem_open F
 GLIBC_2.38 sem_post F
+GLIBC_2.38 sem_timedwait F
+GLIBC_2.38 sem_trywait F
+GLIBC_2.38 sem_wait F
 GLIBC_2.38 semctl F
 GLIBC_2.38 semget F
 GLIBC_2.38 semop F
@@ -2353,12 +2357,16 @@ GLIBC_2.43 pthread_testcancel F
 GLIBC_2.43 pthread_timedjoin_np F
 GLIBC_2.43 pthread_tryjoin_np F
 GLIBC_2.43 pthread_yield F
+GLIBC_2.43 sem_clockwait F
 GLIBC_2.43 sem_close F
 GLIBC_2.43 sem_destroy F
 GLIBC_2.43 sem_getvalue F
 GLIBC_2.43 sem_init F
 GLIBC_2.43 sem_open F
 GLIBC_2.43 sem_post F
+GLIBC_2.43 sem_timedwait F
+GLIBC_2.43 sem_trywait F
+GLIBC_2.43 sem_wait F
 HURD_CTHREADS_0.3 __cthread_getspecific F
 HURD_CTHREADS_0.3 __cthread_keycreate F
 HURD_CTHREADS_0.3 __cthread_setspecific F
index 38cf0d25952c5443c0fafd67d5d43499df4f76fe..4c9ba3b7d5211150e10addad3c60db714429935d 100644 (file)
@@ -43,11 +43,7 @@ GLIBC_2.38 pthread_spin_init F
 GLIBC_2.38 pthread_spin_lock F
 GLIBC_2.38 pthread_spin_trylock F
 GLIBC_2.38 pthread_spin_unlock F
-GLIBC_2.38 sem_clockwait F
-GLIBC_2.38 sem_timedwait F
-GLIBC_2.38 sem_trywait F
 GLIBC_2.38 sem_unlink F
-GLIBC_2.38 sem_wait F
 GLIBC_2.38 thrd_create F
 GLIBC_2.38 thrd_detach F
 GLIBC_2.38 thrd_exit F