htl: move pthread_attr_init into libc.

Signed-off-by: gfleury <gfleury@disroot.org>
This commit is contained in:
gfleury 2024-11-18 13:21:45 +02:00 committed by Samuel Thibault
parent 1a1cedd635
commit 7f045c0b48
10 changed files with 13 additions and 11 deletions

View File

@ -25,7 +25,6 @@ SYSDEPS := lockfile
LCLHDRS := LCLHDRS :=
libpthread-routines := \ libpthread-routines := \
pt-attr-init \
pt-barrier-destroy \ pt-barrier-destroy \
pt-barrier-init \ pt-barrier-init \
pt-barrier-wait \ pt-barrier-wait \
@ -197,6 +196,7 @@ routines := \
pt-attr-getstack \ pt-attr-getstack \
pt-attr-getstackaddr \ pt-attr-getstackaddr \
pt-attr-getstacksize \ pt-attr-getstacksize \
pt-attr-init \
pt-attr-setdetachstate \ pt-attr-setdetachstate \
pt-attr-setguardsize \ pt-attr-setguardsize \
pt-attr-setinheritsched \ pt-attr-setinheritsched \

View File

@ -25,6 +25,7 @@ libc {
pthread_attr_setstack; pthread_attr_setstack;
pthread_attr_setscope; pthread_attr_setscope;
pthread_attr_setschedparam; pthread_attr_setschedparam;
pthread_attr_init;
} }
GLIBC_2.21 { GLIBC_2.21 {
@ -74,6 +75,7 @@ libc {
___pthread_self; ___pthread_self;
__pthread_init_thread; __pthread_init_thread;
__pthread_default_attr; __pthread_default_attr;
__pthread_attr_init;
__pthread_attr_getstacksize; __pthread_attr_getstacksize;
__pthread_attr_getstackaddr; __pthread_attr_getstackaddr;
__pthread_attr_getstack; __pthread_attr_getstack;
@ -108,8 +110,6 @@ libpthread {
pthread_atfork; pthread_atfork;
pthread_attr_init;
pthread_barrier_destroy; pthread_barrier_init; pthread_barrier_wait; pthread_barrier_destroy; pthread_barrier_init; pthread_barrier_wait;
pthread_barrierattr_destroy; pthread_barrierattr_getpshared; pthread_barrierattr_destroy; pthread_barrierattr_getpshared;
pthread_barrierattr_init; pthread_barrierattr_setpshared; pthread_barrierattr_init; pthread_barrierattr_setpshared;

View File

@ -53,8 +53,6 @@ name decl \
#define FORWARD(name, decl, params, defretval) \ #define FORWARD(name, decl, params, defretval) \
FORWARD2 (name, int, decl, params, return defretval) FORWARD2 (name, int, decl, params, return defretval)
FORWARD (pthread_attr_init, (pthread_attr_t *attr), (attr), 0)
FORWARD (pthread_condattr_destroy, (pthread_condattr_t *attr), (attr), 0) FORWARD (pthread_condattr_destroy, (pthread_condattr_t *attr), (attr), 0)
FORWARD (pthread_condattr_init, (pthread_condattr_t *attr), (attr), 0) FORWARD (pthread_condattr_init, (pthread_condattr_t *attr), (attr), 0)

View File

@ -27,7 +27,6 @@
#if IS_IN (libpthread) #if IS_IN (libpthread)
static const struct pthread_functions pthread_functions = { static const struct pthread_functions pthread_functions = {
.ptr_pthread_attr_init = __pthread_attr_init,
.ptr_pthread_condattr_destroy = __pthread_condattr_destroy, .ptr_pthread_condattr_destroy = __pthread_condattr_destroy,
.ptr_pthread_condattr_init = __pthread_condattr_init, .ptr_pthread_condattr_init = __pthread_condattr_init,
.ptr_pthread_cond_broadcast = __pthread_cond_broadcast, .ptr_pthread_cond_broadcast = __pthread_cond_broadcast,

View File

@ -17,6 +17,7 @@
<https://www.gnu.org/licenses/>. */ <https://www.gnu.org/licenses/>. */
#include <pthread.h> #include <pthread.h>
#include <shlib-compat.h>
#include <pt-internal.h> #include <pt-internal.h>
int int
@ -27,4 +28,9 @@ __pthread_attr_init (pthread_attr_t *attr)
*attr = __pthread_default_attr; *attr = __pthread_default_attr;
return 0; return 0;
} }
weak_alias (__pthread_attr_init, pthread_attr_init); libc_hidden_def (__pthread_attr_init)
versioned_symbol (libc, __pthread_attr_init, pthread_attr_init, GLIBC_2_21);
#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21)
compat_symbol (libc, __pthread_attr_init, pthread_attr_init, GLIBC_2_12);
#endif

View File

@ -21,7 +21,6 @@
#include <pthread.h> #include <pthread.h>
int __pthread_attr_init (pthread_attr_t *);
int __pthread_condattr_destroy (pthread_condattr_t *); int __pthread_condattr_destroy (pthread_condattr_t *);
int __pthread_condattr_init (pthread_condattr_t *); int __pthread_condattr_init (pthread_condattr_t *);
int __pthread_cond_broadcast (pthread_cond_t *); int __pthread_cond_broadcast (pthread_cond_t *);
@ -59,7 +58,6 @@ int _cthreads_ftrylockfile (FILE *);
so if possible avoid breaking it and append new hooks to the end. */ so if possible avoid breaking it and append new hooks to the end. */
struct pthread_functions struct pthread_functions
{ {
int (*ptr_pthread_attr_init) (pthread_attr_t *);
int (*ptr_pthread_condattr_destroy) (pthread_condattr_t *); int (*ptr_pthread_condattr_destroy) (pthread_condattr_t *);
int (*ptr_pthread_condattr_init) (pthread_condattr_t *); int (*ptr_pthread_condattr_init) (pthread_condattr_t *);
int (*ptr_pthread_cond_broadcast) (pthread_cond_t *); int (*ptr_pthread_cond_broadcast) (pthread_cond_t *);

View File

@ -97,10 +97,12 @@ libc_hidden_proto (__pthread_attr_setstack)
int __pthread_attr_getstack (const pthread_attr_t *, void **, size_t *); int __pthread_attr_getstack (const pthread_attr_t *, void **, size_t *);
libc_hidden_proto (__pthread_attr_getstack) libc_hidden_proto (__pthread_attr_getstack)
void __pthread_testcancel (void); void __pthread_testcancel (void);
int __pthread_attr_init (pthread_attr_t *attr);
#define __pthread_raise_internal(__sig) raise (__sig) #define __pthread_raise_internal(__sig) raise (__sig)
libc_hidden_proto (__pthread_self) libc_hidden_proto (__pthread_self)
libc_hidden_proto (__pthread_attr_init)
#if IS_IN (libpthread) #if IS_IN (libpthread)
hidden_proto (__pthread_create) hidden_proto (__pthread_create)

View File

@ -39,6 +39,7 @@ GLIBC_2.12 pthread_attr_getscope F
GLIBC_2.12 pthread_attr_getstack F GLIBC_2.12 pthread_attr_getstack F
GLIBC_2.12 pthread_attr_getstackaddr F GLIBC_2.12 pthread_attr_getstackaddr F
GLIBC_2.12 pthread_attr_getstacksize F GLIBC_2.12 pthread_attr_getstacksize F
GLIBC_2.12 pthread_attr_init F
GLIBC_2.12 pthread_attr_setdetachstate F GLIBC_2.12 pthread_attr_setdetachstate F
GLIBC_2.12 pthread_attr_setguardsize F GLIBC_2.12 pthread_attr_setguardsize F
GLIBC_2.12 pthread_attr_setinheritsched F GLIBC_2.12 pthread_attr_setinheritsched F

View File

@ -22,7 +22,6 @@ GLIBC_2.12 flockfile F
GLIBC_2.12 ftrylockfile F GLIBC_2.12 ftrylockfile F
GLIBC_2.12 funlockfile F GLIBC_2.12 funlockfile F
GLIBC_2.12 pthread_atfork F GLIBC_2.12 pthread_atfork F
GLIBC_2.12 pthread_attr_init F
GLIBC_2.12 pthread_barrier_destroy F GLIBC_2.12 pthread_barrier_destroy F
GLIBC_2.12 pthread_barrier_init F GLIBC_2.12 pthread_barrier_init F
GLIBC_2.12 pthread_barrier_wait F GLIBC_2.12 pthread_barrier_wait F

View File

@ -39,7 +39,6 @@ GLIBC_2.38 mtx_lock F
GLIBC_2.38 mtx_timedlock F GLIBC_2.38 mtx_timedlock F
GLIBC_2.38 mtx_trylock F GLIBC_2.38 mtx_trylock F
GLIBC_2.38 mtx_unlock F GLIBC_2.38 mtx_unlock F
GLIBC_2.38 pthread_attr_init F
GLIBC_2.38 pthread_barrier_destroy F GLIBC_2.38 pthread_barrier_destroy F
GLIBC_2.38 pthread_barrier_init F GLIBC_2.38 pthread_barrier_init F
GLIBC_2.38 pthread_barrier_wait F GLIBC_2.38 pthread_barrier_wait F