aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-05-05 17:15:57 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-05-05 17:19:48 +0200
commit018c75dcb1ee93f3ff0d3d9cbdf1fe48aa630315 (patch)
treea3553b7fa23e420e93f1f23a3fb7d7aea95765dc /nptl
parent793042c63c511f5280e960108b2f0b13e115245d (diff)
downloadglibc-018c75dcb1ee93f3ff0d3d9cbdf1fe48aa630315.tar
glibc-018c75dcb1ee93f3ff0d3d9cbdf1fe48aa630315.tar.gz
glibc-018c75dcb1ee93f3ff0d3d9cbdf1fe48aa630315.tar.bz2
glibc-018c75dcb1ee93f3ff0d3d9cbdf1fe48aa630315.zip
nptl: Move sem_timedwait into libc
The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl')
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/Versions3
-rw-r--r--nptl/sem_timedwait.c18
-rw-r--r--nptl/semaphoreP.h2
4 files changed, 17 insertions, 8 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index 36c0f270b9..9f73cf2434 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -158,6 +158,7 @@ routines = \
sem_open \
sem_post \
sem_routines \
+ sem_timedwait \
tpp \
unwind \
@@ -209,7 +210,6 @@ libpthread-routines = \
pthread_sigqueue \
pthread_timedjoin \
pthread_tryjoin \
- sem_timedwait \
sem_unlink \
sem_wait \
vars \
diff --git a/nptl/Versions b/nptl/Versions
index df3967516f..f19c2355f1 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -114,6 +114,7 @@ libc {
pthread_spin_trylock;
pthread_spin_unlock;
pthread_yield;
+ sem_timedwait;
}
GLIBC_2.2.3 {
pthread_getattr_np;
@@ -267,6 +268,7 @@ libc {
sem_init;
sem_open;
sem_post;
+ sem_timedwait;
thrd_exit;
tss_create;
tss_delete;
@@ -371,7 +373,6 @@ libpthread {
pthread_yield;
pthread_rwlock_timedrdlock;
pthread_rwlock_timedwrlock;
- sem_timedwait;
}
GLIBC_2.2.3 {
diff --git a/nptl/sem_timedwait.c b/nptl/sem_timedwait.c
index 770020e26c..584546c706 100644
--- a/nptl/sem_timedwait.c
+++ b/nptl/sem_timedwait.c
@@ -24,7 +24,7 @@
/* This is in a separate file because because sem_timedwait is only provided
if __USE_XOPEN2K is defined. */
int
-__sem_timedwait64 (sem_t *sem, const struct __timespec64 *abstime)
+___sem_timedwait64 (sem_t *sem, const struct __timespec64 *abstime)
{
if (! valid_nanoseconds (abstime->tv_nsec))
{
@@ -42,15 +42,23 @@ __sem_timedwait64 (sem_t *sem, const struct __timespec64 *abstime)
CLOCK_REALTIME, abstime);
}
-#if __TIMESIZE != 64
-libpthread_hidden_def (__sem_timedwait64)
+#if __TIMESIZE == 64
+strong_alias (___sem_timedwait64, ___sem_timedwait)
+#else /* __TIMESPEC64 != 64 */
+libc_hidden_ver (___sem_timedwait64, __sem_timedwait64)
+#ifndef SHARED
+strong_alias (___sem_timedwait64, __sem_timedwait64)
+#endif
int
-__sem_timedwait (sem_t *sem, const struct timespec *abstime)
+___sem_timedwait (sem_t *sem, const struct timespec *abstime)
{
struct __timespec64 ts64 = valid_timespec_to_timespec64 (*abstime);
return __sem_timedwait64 (sem, &ts64);
}
+#endif /* __TIMESPEC64 != 64 */
+versioned_symbol (libc, ___sem_timedwait, sem_timedwait, GLIBC_2_34);
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_34)
+compat_symbol (libpthread, ___sem_timedwait, sem_timedwait, GLIBC_2_2);
#endif
-weak_alias (__sem_timedwait, sem_timedwait)
diff --git a/nptl/semaphoreP.h b/nptl/semaphoreP.h
index f030f0e4de..43ad849761 100644
--- a/nptl/semaphoreP.h
+++ b/nptl/semaphoreP.h
@@ -57,5 +57,5 @@ __sem_clockwait64 (sem_t *sem, clockid_t clockid,
libc_hidden_proto (__sem_clockwait64)
extern int
__sem_timedwait64 (sem_t *sem, const struct __timespec64 *abstime);
-libpthread_hidden_proto (__sem_timedwait64)
+libc_hidden_proto (__sem_timedwait64)
#endif