htl: move pthread_mutexattr_settype, pthread_mutexattr_gettype into libc.

Message-ID: <20241231134909.1166440-6-gfleury@disroot.org>
This commit is contained in:
gfleury 2024-12-31 15:49:06 +02:00 committed by Samuel Thibault
parent 3cd1cf5fe0
commit b386295727
9 changed files with 37 additions and 11 deletions

View File

@ -56,10 +56,8 @@ libpthread-routines := \
pt-cancel \
pt-mutexattr-getprioceiling \
pt-mutexattr-getpshared \
pt-mutexattr-gettype \
pt-mutexattr-setprioceiling \
pt-mutexattr-setpshared \
pt-mutexattr-settype \
pt-mutexattr-getrobust \
pt-mutexattr-setrobust \
pt-mutex-init \
@ -199,8 +197,10 @@ routines := \
pt-mutex-checklocked \
pt-mutexattr-destroy \
pt-mutexattr-getprotocol \
pt-mutexattr-gettype \
pt-mutexattr-init \
pt-mutexattr-setprotocol \
pt-mutexattr-settype \
pt-nthreads \
pt-pthread_self \
pt-self pt-equal \

View File

@ -40,8 +40,10 @@ libc {
pthread_condattr_setpshared;
pthread_mutexattr_destroy;
pthread_mutexattr_getprotocol;
pthread_mutexattr_gettype;
pthread_mutexattr_init;
pthread_mutexattr_setprotocol;
pthread_mutexattr_settype;
pthread_sigmask;
}
@ -88,7 +90,9 @@ libc {
pthread_condattr_setclock;
pthread_condattr_setpshared;
pthread_mutexattr_getprotocol;
pthread_mutexattr_gettype;
pthread_mutexattr_setprotocol;
pthread_mutexattr_settype;
pthread_sigmask;
}
@ -122,6 +126,7 @@ libc {
__pthread_mutex_checklocked;
__pthread_mutexattr_destroy;
__pthread_mutexattr_init;
__pthread_mutexattr_settype;
__pthread_sigstate;
__pthread_sigstate_destroy;
__pthread_sigmask;
@ -184,9 +189,8 @@ libpthread {
pthread_mutexattr_getprioceiling;
pthread_mutexattr_getpshared;
pthread_mutexattr_gettype;
pthread_mutexattr_setprioceiling;
pthread_mutexattr_setpshared; pthread_mutexattr_settype;
pthread_mutexattr_setpshared;
pthread_once;

View File

@ -47,6 +47,13 @@ extern int __pthread_mutexattr_setprotocol(pthread_mutexattr_t *__attr,
int __protocol);
libc_hidden_proto (__pthread_mutexattr_setprotocol)
extern int __pthread_mutexattr_gettype(const pthread_mutexattr_t *__restrict __attr,
int *__restrict __type);
libc_hidden_proto (__pthread_mutexattr_gettype)
extern int __pthread_mutexattr_settype(pthread_mutexattr_t *__attr,
int __type);
libc_hidden_proto (__pthread_mutexattr_settype)
extern int __pthread_cond_init (pthread_cond_t *cond,
const pthread_condattr_t *cond_attr);
libc_hidden_proto (__pthread_cond_init)

View File

@ -16,16 +16,23 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <pthreadP.h>
#include <stdlib.h>
#include <assert.h>
#include <pt-internal.h>
#include "pt-mutex.h"
#include <hurdlock.h>
#include <shlib-compat.h>
int
pthread_mutexattr_gettype (const pthread_mutexattr_t *attrp, int *outp)
__pthread_mutexattr_gettype (const pthread_mutexattr_t *attrp, int *outp)
{
*outp = attrp->__mutex_type;
return 0;
}
libc_hidden_def (__pthread_mutexattr_gettype)
versioned_symbol (libc, __pthread_mutexattr_gettype, pthread_mutexattr_gettype, GLIBC_2_41);
#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_41)
compat_symbol (libpthread, __pthread_mutexattr_gettype,pthread_mutexattr_gettype, GLIBC_2_12);
#endif

View File

@ -22,6 +22,7 @@
#include <pt-internal.h>
#include "pt-mutex.h"
#include <hurdlock.h>
#include <shlib-compat.h>
int
__pthread_mutexattr_settype (pthread_mutexattr_t *attrp, int type)
@ -32,4 +33,9 @@ __pthread_mutexattr_settype (pthread_mutexattr_t *attrp, int type)
attrp->__mutex_type = type;
return 0;
}
weak_alias (__pthread_mutexattr_settype, pthread_mutexattr_settype)
libc_hidden_def (__pthread_mutexattr_settype)
versioned_symbol (libc, __pthread_mutexattr_settype, pthread_mutexattr_settype, GLIBC_2_41);
#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_41)
compat_symbol (libpthread, __pthread_mutexattr_settype,pthread_mutexattr_settype, GLIBC_2_12);
#endif

View File

@ -65,8 +65,10 @@ GLIBC_2.12 pthread_equal F
GLIBC_2.12 pthread_getschedparam F
GLIBC_2.12 pthread_mutexattr_destroy F
GLIBC_2.12 pthread_mutexattr_getprotocol F
GLIBC_2.12 pthread_mutexattr_gettype F
GLIBC_2.12 pthread_mutexattr_init F
GLIBC_2.12 pthread_mutexattr_setprotocol F
GLIBC_2.12 pthread_mutexattr_settype F
GLIBC_2.12 pthread_self F
GLIBC_2.12 pthread_setschedparam F
GLIBC_2.12 pthread_sigmask F
@ -2526,6 +2528,7 @@ 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_mutexattr_getprotocol F
GLIBC_2.41 pthread_mutexattr_gettype F
GLIBC_2.41 pthread_mutexattr_setprotocol F
GLIBC_2.41 pthread_sigmask F
GLIBC_2.5 __readlinkat_chk F

View File

@ -52,10 +52,8 @@ GLIBC_2.12 pthread_mutex_trylock F
GLIBC_2.12 pthread_mutex_unlock F
GLIBC_2.12 pthread_mutexattr_getprioceiling F
GLIBC_2.12 pthread_mutexattr_getpshared F
GLIBC_2.12 pthread_mutexattr_gettype F
GLIBC_2.12 pthread_mutexattr_setprioceiling F
GLIBC_2.12 pthread_mutexattr_setpshared F
GLIBC_2.12 pthread_mutexattr_settype F
GLIBC_2.12 pthread_once F
GLIBC_2.12 pthread_rwlock_destroy F
GLIBC_2.12 pthread_rwlock_init F

View File

@ -1553,8 +1553,10 @@ GLIBC_2.38 pthread_mutex_lock F
GLIBC_2.38 pthread_mutex_unlock F
GLIBC_2.38 pthread_mutexattr_destroy F
GLIBC_2.38 pthread_mutexattr_getprotocol F
GLIBC_2.38 pthread_mutexattr_gettype F
GLIBC_2.38 pthread_mutexattr_init F
GLIBC_2.38 pthread_mutexattr_setprotocol F
GLIBC_2.38 pthread_mutexattr_settype F
GLIBC_2.38 pthread_self F
GLIBC_2.38 pthread_setcancelstate F
GLIBC_2.38 pthread_setcanceltype F
@ -2215,6 +2217,7 @@ 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_mutexattr_getprotocol F
GLIBC_2.41 pthread_mutexattr_gettype F
GLIBC_2.41 pthread_mutexattr_setprotocol F
GLIBC_2.41 pthread_sigmask F
HURD_CTHREADS_0.3 __cthread_getspecific F

View File

@ -77,12 +77,10 @@ GLIBC_2.38 pthread_mutexattr_getprioceiling F
GLIBC_2.38 pthread_mutexattr_getpshared F
GLIBC_2.38 pthread_mutexattr_getrobust F
GLIBC_2.38 pthread_mutexattr_getrobust_np F
GLIBC_2.38 pthread_mutexattr_gettype F
GLIBC_2.38 pthread_mutexattr_setprioceiling F
GLIBC_2.38 pthread_mutexattr_setpshared F
GLIBC_2.38 pthread_mutexattr_setrobust F
GLIBC_2.38 pthread_mutexattr_setrobust_np F
GLIBC_2.38 pthread_mutexattr_settype F
GLIBC_2.38 pthread_once F
GLIBC_2.38 pthread_rwlock_clockrdlock F
GLIBC_2.38 pthread_rwlock_clockwrlock F