mirror of
https://sourceware.org/git/glibc.git
synced 2025-10-27 12:15:39 +03:00
htl: move sem_open, sem_close into libc.
Message-ID: <20250817104023.91919-5-gfleury@disroot.org>
This commit is contained in:
@@ -34,15 +34,12 @@ libpthread-routines := \
|
|||||||
pt-spin \
|
pt-spin \
|
||||||
pt-getname-np \
|
pt-getname-np \
|
||||||
pt-setname-np \
|
pt-setname-np \
|
||||||
sem_close \
|
|
||||||
sem_open \
|
|
||||||
sem-post \
|
sem-post \
|
||||||
sem-timedwait \
|
sem-timedwait \
|
||||||
sem-trywait \
|
sem-trywait \
|
||||||
sem_unlink \
|
sem_unlink \
|
||||||
sem-wait \
|
sem-wait \
|
||||||
sem-waitfast \
|
sem-waitfast \
|
||||||
sem_routines \
|
|
||||||
cancellation \
|
cancellation \
|
||||||
cthreads-compat \
|
cthreads-compat \
|
||||||
herrno \
|
herrno \
|
||||||
@@ -211,6 +208,9 @@ routines := \
|
|||||||
sem-destroy \
|
sem-destroy \
|
||||||
sem-getvalue \
|
sem-getvalue \
|
||||||
sem-init \
|
sem-init \
|
||||||
|
sem_close \
|
||||||
|
sem_open \
|
||||||
|
sem_routines \
|
||||||
# routines
|
# routines
|
||||||
shared-only-routines = forward
|
shared-only-routines = forward
|
||||||
|
|
||||||
|
|||||||
@@ -101,9 +101,11 @@ libc {
|
|||||||
pthread_sigmask;
|
pthread_sigmask;
|
||||||
pthread_testcancel;
|
pthread_testcancel;
|
||||||
pthread_yield;
|
pthread_yield;
|
||||||
|
sem_close;
|
||||||
sem_destroy;
|
sem_destroy;
|
||||||
sem_getvalue;
|
sem_getvalue;
|
||||||
sem_init;
|
sem_init;
|
||||||
|
sem_open;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLIBC_2.21 {
|
GLIBC_2.21 {
|
||||||
@@ -222,9 +224,11 @@ libc {
|
|||||||
pthread_timedjoin_np;
|
pthread_timedjoin_np;
|
||||||
pthread_tryjoin_np;
|
pthread_tryjoin_np;
|
||||||
pthread_yield;
|
pthread_yield;
|
||||||
|
sem_close;
|
||||||
sem_destroy;
|
sem_destroy;
|
||||||
sem_getvalue;
|
sem_getvalue;
|
||||||
sem_init;
|
sem_init;
|
||||||
|
sem_open;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLIBC_PRIVATE {
|
GLIBC_PRIVATE {
|
||||||
@@ -317,7 +321,7 @@ libpthread {
|
|||||||
|
|
||||||
pthread_create;
|
pthread_create;
|
||||||
|
|
||||||
sem_close; sem_open; sem_post;
|
sem_post;
|
||||||
sem_timedwait; sem_trywait; sem_unlink; sem_wait;
|
sem_timedwait; sem_trywait; sem_unlink; sem_wait;
|
||||||
|
|
||||||
pthread_spin_destroy; pthread_spin_init; pthread_spin_lock;
|
pthread_spin_destroy; pthread_spin_init; pthread_spin_lock;
|
||||||
|
|||||||
@@ -128,9 +128,11 @@ GLIBC_2.12 pthread_setspecific F
|
|||||||
GLIBC_2.12 pthread_sigmask F
|
GLIBC_2.12 pthread_sigmask F
|
||||||
GLIBC_2.12 pthread_testcancel F
|
GLIBC_2.12 pthread_testcancel F
|
||||||
GLIBC_2.12 pthread_yield F
|
GLIBC_2.12 pthread_yield F
|
||||||
|
GLIBC_2.12 sem_close F
|
||||||
GLIBC_2.12 sem_destroy F
|
GLIBC_2.12 sem_destroy F
|
||||||
GLIBC_2.12 sem_getvalue F
|
GLIBC_2.12 sem_getvalue F
|
||||||
GLIBC_2.12 sem_init F
|
GLIBC_2.12 sem_init F
|
||||||
|
GLIBC_2.12 sem_open F
|
||||||
GLIBC_2.13 __fentry__ F
|
GLIBC_2.13 __fentry__ F
|
||||||
GLIBC_2.14 syncfs F
|
GLIBC_2.14 syncfs F
|
||||||
GLIBC_2.15 __fdelt_chk F
|
GLIBC_2.15 __fdelt_chk F
|
||||||
@@ -2669,9 +2671,11 @@ GLIBC_2.43 pthread_testcancel F
|
|||||||
GLIBC_2.43 pthread_timedjoin_np F
|
GLIBC_2.43 pthread_timedjoin_np F
|
||||||
GLIBC_2.43 pthread_tryjoin_np F
|
GLIBC_2.43 pthread_tryjoin_np F
|
||||||
GLIBC_2.43 pthread_yield F
|
GLIBC_2.43 pthread_yield F
|
||||||
|
GLIBC_2.43 sem_close F
|
||||||
GLIBC_2.43 sem_destroy F
|
GLIBC_2.43 sem_destroy F
|
||||||
GLIBC_2.43 sem_getvalue F
|
GLIBC_2.43 sem_getvalue F
|
||||||
GLIBC_2.43 sem_init F
|
GLIBC_2.43 sem_init F
|
||||||
|
GLIBC_2.43 sem_open F
|
||||||
GLIBC_2.5 __readlinkat_chk F
|
GLIBC_2.5 __readlinkat_chk F
|
||||||
GLIBC_2.5 inet6_opt_append F
|
GLIBC_2.5 inet6_opt_append F
|
||||||
GLIBC_2.5 inet6_opt_find F
|
GLIBC_2.5 inet6_opt_find F
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ GLIBC_2.12 pthread_spin_init F
|
|||||||
GLIBC_2.12 pthread_spin_lock F
|
GLIBC_2.12 pthread_spin_lock F
|
||||||
GLIBC_2.12 pthread_spin_trylock F
|
GLIBC_2.12 pthread_spin_trylock F
|
||||||
GLIBC_2.12 pthread_spin_unlock F
|
GLIBC_2.12 pthread_spin_unlock F
|
||||||
GLIBC_2.12 sem_close F
|
|
||||||
GLIBC_2.12 sem_open F
|
|
||||||
GLIBC_2.12 sem_post F
|
GLIBC_2.12 sem_post F
|
||||||
GLIBC_2.12 sem_timedwait F
|
GLIBC_2.12 sem_timedwait F
|
||||||
GLIBC_2.12 sem_trywait F
|
GLIBC_2.12 sem_trywait F
|
||||||
|
|||||||
@@ -1759,9 +1759,11 @@ GLIBC_2.38 seed48 F
|
|||||||
GLIBC_2.38 seed48_r F
|
GLIBC_2.38 seed48_r F
|
||||||
GLIBC_2.38 seekdir F
|
GLIBC_2.38 seekdir F
|
||||||
GLIBC_2.38 select F
|
GLIBC_2.38 select F
|
||||||
|
GLIBC_2.38 sem_close F
|
||||||
GLIBC_2.38 sem_destroy F
|
GLIBC_2.38 sem_destroy F
|
||||||
GLIBC_2.38 sem_getvalue F
|
GLIBC_2.38 sem_getvalue F
|
||||||
GLIBC_2.38 sem_init F
|
GLIBC_2.38 sem_init F
|
||||||
|
GLIBC_2.38 sem_open F
|
||||||
GLIBC_2.38 semctl F
|
GLIBC_2.38 semctl F
|
||||||
GLIBC_2.38 semget F
|
GLIBC_2.38 semget F
|
||||||
GLIBC_2.38 semop F
|
GLIBC_2.38 semop F
|
||||||
@@ -2350,9 +2352,11 @@ GLIBC_2.43 pthread_testcancel F
|
|||||||
GLIBC_2.43 pthread_timedjoin_np F
|
GLIBC_2.43 pthread_timedjoin_np F
|
||||||
GLIBC_2.43 pthread_tryjoin_np F
|
GLIBC_2.43 pthread_tryjoin_np F
|
||||||
GLIBC_2.43 pthread_yield F
|
GLIBC_2.43 pthread_yield F
|
||||||
|
GLIBC_2.43 sem_close F
|
||||||
GLIBC_2.43 sem_destroy F
|
GLIBC_2.43 sem_destroy F
|
||||||
GLIBC_2.43 sem_getvalue F
|
GLIBC_2.43 sem_getvalue F
|
||||||
GLIBC_2.43 sem_init F
|
GLIBC_2.43 sem_init F
|
||||||
|
GLIBC_2.43 sem_open F
|
||||||
HURD_CTHREADS_0.3 __cthread_getspecific F
|
HURD_CTHREADS_0.3 __cthread_getspecific F
|
||||||
HURD_CTHREADS_0.3 __cthread_keycreate F
|
HURD_CTHREADS_0.3 __cthread_keycreate F
|
||||||
HURD_CTHREADS_0.3 __cthread_setspecific F
|
HURD_CTHREADS_0.3 __cthread_setspecific F
|
||||||
|
|||||||
@@ -44,8 +44,6 @@ GLIBC_2.38 pthread_spin_lock F
|
|||||||
GLIBC_2.38 pthread_spin_trylock F
|
GLIBC_2.38 pthread_spin_trylock F
|
||||||
GLIBC_2.38 pthread_spin_unlock F
|
GLIBC_2.38 pthread_spin_unlock F
|
||||||
GLIBC_2.38 sem_clockwait F
|
GLIBC_2.38 sem_clockwait F
|
||||||
GLIBC_2.38 sem_close F
|
|
||||||
GLIBC_2.38 sem_open F
|
|
||||||
GLIBC_2.38 sem_post F
|
GLIBC_2.38 sem_post F
|
||||||
GLIBC_2.38 sem_timedwait F
|
GLIBC_2.38 sem_timedwait F
|
||||||
GLIBC_2.38 sem_trywait F
|
GLIBC_2.38 sem_trywait F
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "semaphoreP.h"
|
#include "semaphoreP.h"
|
||||||
#include <sem_routines.h>
|
#include <sem_routines.h>
|
||||||
|
#include <shlib-compat.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
__sem_close (sem_t *sem)
|
__sem_close (sem_t *sem)
|
||||||
@@ -30,11 +31,14 @@ __sem_close (sem_t *sem)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#if PTHREAD_IN_LIBC
|
#ifndef __PTHREAD_HTL
|
||||||
versioned_symbol (libc, __sem_close, sem_close, GLIBC_2_34);
|
versioned_symbol (libc, __sem_close, sem_close, GLIBC_2_34);
|
||||||
# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_1_1, GLIBC_2_34)
|
# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_1_1, GLIBC_2_34)
|
||||||
compat_symbol (libpthread, __sem_close, sem_close, GLIBC_2_1_1);
|
compat_symbol (libpthread, __sem_close, sem_close, GLIBC_2_1_1);
|
||||||
# endif
|
# endif
|
||||||
#else /* !PTHREAD_IN_LIBC */
|
#else /* __PTHREAD_HTL */
|
||||||
strong_alias (__sem_close, sem_close)
|
versioned_symbol (libc, __sem_close, sem_close, GLIBC_2_43);
|
||||||
|
# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43)
|
||||||
|
compat_symbol (libpthread, __sem_close, sem_close, GLIBC_2_12);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -25,13 +25,8 @@
|
|||||||
#include <sem_routines.h>
|
#include <sem_routines.h>
|
||||||
#include <futex-internal.h>
|
#include <futex-internal.h>
|
||||||
#include <libc-lock.h>
|
#include <libc-lock.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <shlib-compat.h>
|
||||||
#if !PTHREAD_IN_LIBC
|
|
||||||
/* The private names are not exported from libc. */
|
|
||||||
# define __link link
|
|
||||||
# define __unlink unlink
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define SEM_OPEN_FLAGS (O_RDWR | O_NOFOLLOW | O_CLOEXEC)
|
#define SEM_OPEN_FLAGS (O_RDWR | O_NOFOLLOW | O_CLOEXEC)
|
||||||
|
|
||||||
@@ -215,11 +210,14 @@ out:
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#if PTHREAD_IN_LIBC
|
#ifndef __PTHREAD_HTL
|
||||||
versioned_symbol (libc, __sem_open, sem_open, GLIBC_2_34);
|
versioned_symbol (libc, __sem_open, sem_open, GLIBC_2_34);
|
||||||
# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_1_1, GLIBC_2_34)
|
# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_1_1, GLIBC_2_34)
|
||||||
compat_symbol (libpthread, __sem_open, sem_open, GLIBC_2_1_1);
|
compat_symbol (libpthread, __sem_open, sem_open, GLIBC_2_1_1);
|
||||||
# endif
|
# endif
|
||||||
#else /* !PTHREAD_IN_LIBC */
|
#else /* __PTHREAD_HTL */
|
||||||
strong_alias (__sem_open, sem_open)
|
versioned_symbol (libc, __sem_open, sem_open, GLIBC_2_43);
|
||||||
|
# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43)
|
||||||
|
compat_symbol (libpthread, __sem_open, sem_open, GLIBC_2_12);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include <semaphoreP.h>
|
#include <semaphoreP.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sem_routines.h>
|
#include <sem_routines.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
/* Keeping track of currently used mappings. */
|
/* Keeping track of currently used mappings. */
|
||||||
struct inuse_sem
|
struct inuse_sem
|
||||||
|
|||||||
Reference in New Issue
Block a user