[PATCH 04/13] htl move pthread_attr_getscope into libc.

gfleury gfleury@disroot.org
Mon Nov 18 11:21:36 GMT 2024


Signed-off-by: gfleury <gfleury@disroot.org>
---
 htl/Makefile                                | 2 +-
 htl/Versions                                | 3 ++-
 htl/forward.c                               | 2 --
 htl/pt-initialize.c                         | 1 -
 sysdeps/htl/pt-attr-getscope.c              | 6 +++++-
 sysdeps/htl/pthread-functions.h             | 2 --
 sysdeps/mach/hurd/i386/libc.abilist         | 1 +
 sysdeps/mach/hurd/i386/libpthread.abilist   | 1 -
 sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 -
 9 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/htl/Makefile b/htl/Makefile
index a5028d1b..8e5eeb50 100644
--- a/htl/Makefile
+++ b/htl/Makefile
@@ -25,7 +25,6 @@ SYSDEPS := lockfile
 LCLHDRS :=
 
 libpthread-routines := \
-  pt-attr-getscope \
   pt-attr-getstack \
   pt-attr-getstackaddr \
   pt-attr-getstacksize \
@@ -211,6 +210,7 @@ routines := \
   pt-attr-destroy \
   pt-attr \
   pt-attr-getguardsize \
+  pt-attr-getscope \
   # routines
 shared-only-routines = forward
 
diff --git a/htl/Versions b/htl/Versions
index 336d81bd..4372c2de 100644
--- a/htl/Versions
+++ b/htl/Versions
@@ -15,6 +15,7 @@ libc {
     pthread_setschedparam;
     pthread_attr_destroy;
     pthread_attr_getguardsize;
+    pthread_attr_getscope;
   }
 
   GLIBC_2.21 {
@@ -85,7 +86,7 @@ libpthread {
 
     pthread_atfork;
 
-    pthread_attr_getscope; pthread_attr_getstack; pthread_attr_getstackaddr;
+    pthread_attr_getstack; pthread_attr_getstackaddr;
     pthread_attr_getstacksize; pthread_attr_init;
     pthread_attr_setguardsize;
     pthread_attr_setschedparam;
diff --git a/htl/forward.c b/htl/forward.c
index 579e8cba..6644d67d 100644
--- a/htl/forward.c
+++ b/htl/forward.c
@@ -59,8 +59,6 @@ FORWARD (pthread_attr_setschedparam,
 	 (pthread_attr_t *attr, const struct sched_param *param),
 	 (attr, param), 0)
 
-FORWARD (pthread_attr_getscope,
-	 (const pthread_attr_t *attr, int *scope), (attr, scope), 0)
 FORWARD (pthread_attr_setscope, (pthread_attr_t *attr, int scope),
 	 (attr, scope), 0)
 
diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c
index 0368bfa4..0d20f39e 100644
--- a/htl/pt-initialize.c
+++ b/htl/pt-initialize.c
@@ -29,7 +29,6 @@
 static const struct pthread_functions pthread_functions = {
   .ptr_pthread_attr_init = __pthread_attr_init,
   .ptr_pthread_attr_setschedparam = __pthread_attr_setschedparam,
-  .ptr_pthread_attr_getscope = __pthread_attr_getscope,
   .ptr_pthread_attr_setscope = __pthread_attr_setscope,
   .ptr_pthread_condattr_destroy = __pthread_condattr_destroy,
   .ptr_pthread_condattr_init = __pthread_condattr_init,
diff --git a/sysdeps/htl/pt-attr-getscope.c b/sysdeps/htl/pt-attr-getscope.c
index a1ef854c..fe1f663b 100644
--- a/sysdeps/htl/pt-attr-getscope.c
+++ b/sysdeps/htl/pt-attr-getscope.c
@@ -17,6 +17,7 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <pthread.h>
+#include <shlib-compat.h>
 #include <pt-internal.h>
 
 int
@@ -25,5 +26,8 @@ __pthread_attr_getscope (const pthread_attr_t *attr, int *contentionscope)
   *contentionscope = attr->__contentionscope;
   return 0;
 }
+versioned_symbol (libc, __pthread_attr_getscope, pthread_attr_getscope, GLIBC_2_21);
 
-weak_alias (__pthread_attr_getscope, pthread_attr_getscope);
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21)
+compat_symbol (libc, __pthread_attr_getscope, pthread_attr_getscope, GLIBC_2_12);
+#endif
diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h
index 9cea6d05..c95735ec 100644
--- a/sysdeps/htl/pthread-functions.h
+++ b/sysdeps/htl/pthread-functions.h
@@ -24,7 +24,6 @@
 int __pthread_attr_init (pthread_attr_t *);
 int __pthread_attr_setschedparam (pthread_attr_t *,
 				 const struct sched_param *);
-int __pthread_attr_getscope (const pthread_attr_t *, int *);
 int __pthread_attr_setscope (pthread_attr_t *, int);
 int __pthread_condattr_destroy (pthread_condattr_t *);
 int __pthread_condattr_init (pthread_condattr_t *);
@@ -67,7 +66,6 @@ struct pthread_functions
   int (*ptr_pthread_attr_init) (pthread_attr_t *);
   int (*ptr_pthread_attr_setschedparam) (pthread_attr_t *,
 					 const struct sched_param *);
-  int (*ptr_pthread_attr_getscope) (const pthread_attr_t *, int *);
   int (*ptr_pthread_attr_setscope) (pthread_attr_t *, int);
   int (*ptr_pthread_condattr_destroy) (pthread_condattr_t *);
   int (*ptr_pthread_condattr_init) (pthread_condattr_t *);
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index 122dfc63..47a4b3d9 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -35,6 +35,7 @@ GLIBC_2.12 pthread_attr_getguardsize F
 GLIBC_2.12 pthread_attr_getinheritsched F
 GLIBC_2.12 pthread_attr_getschedparam F
 GLIBC_2.12 pthread_attr_getschedpolicy F
+GLIBC_2.12 pthread_attr_getscope F
 GLIBC_2.12 pthread_attr_setdetachstate F
 GLIBC_2.12 pthread_attr_setinheritsched F
 GLIBC_2.12 pthread_attr_setschedpolicy F
diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist
index 3451543d..03fcee4c 100644
--- a/sysdeps/mach/hurd/i386/libpthread.abilist
+++ b/sysdeps/mach/hurd/i386/libpthread.abilist
@@ -22,7 +22,6 @@ GLIBC_2.12 flockfile F
 GLIBC_2.12 ftrylockfile F
 GLIBC_2.12 funlockfile F
 GLIBC_2.12 pthread_atfork F
-GLIBC_2.12 pthread_attr_getscope F
 GLIBC_2.12 pthread_attr_getstack F
 GLIBC_2.12 pthread_attr_getstackaddr F
 GLIBC_2.12 pthread_attr_getstacksize F
diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist
index 556cc6e2..1d189726 100644
--- a/sysdeps/mach/hurd/x86_64/libpthread.abilist
+++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist
@@ -39,7 +39,6 @@ GLIBC_2.38 mtx_lock F
 GLIBC_2.38 mtx_timedlock F
 GLIBC_2.38 mtx_trylock F
 GLIBC_2.38 mtx_unlock F
-GLIBC_2.38 pthread_attr_getscope F
 GLIBC_2.38 pthread_attr_getstack F
 GLIBC_2.38 pthread_attr_getstackaddr F
 GLIBC_2.38 pthread_attr_getstacksize F
-- 
2.39.5



More information about the Libc-alpha mailing list