summary refs log tree commit diff
path: root/nptl/pthread_mutex_timedlock.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-04-23 09:43:24 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-04-23 09:43:24 +0200
commit4372dc7eaaa81fc04554626b7f02c9759a04a65b (patch)
tree0b2bb229d8a9d4cf9604d7ab45eff31dae24cc52 /nptl/pthread_mutex_timedlock.c
parenta2975191d0e852ba2501f4cf1588aae76bdad303 (diff)
downloadglibc-4372dc7eaaa81fc04554626b7f02c9759a04a65b.tar.gz
glibc-4372dc7eaaa81fc04554626b7f02c9759a04a65b.tar.xz
glibc-4372dc7eaaa81fc04554626b7f02c9759a04a65b.zip
nptl: Move pthread_mutex_timedlock, pthread_mutex_clocklock to libc
The symbols were moved using scripts/move-symbol-to-libc.py.
The symbol aliasing follows pthread_cond_timedwait et al.
Missing hidden prototypes had to be added to nptl/pthreadP.h
for consistency.
Diffstat (limited to 'nptl/pthread_mutex_timedlock.c')
-rw-r--r--nptl/pthread_mutex_timedlock.c52
1 files changed, 37 insertions, 15 deletions
diff --git a/nptl/pthread_mutex_timedlock.c b/nptl/pthread_mutex_timedlock.c
index 5e52a4d856..b9cc0a24a1 100644
--- a/nptl/pthread_mutex_timedlock.c
+++ b/nptl/pthread_mutex_timedlock.c
@@ -571,9 +571,9 @@ __pthread_mutex_clocklock_common (pthread_mutex_t *mutex,
 }
 
 int
-__pthread_mutex_clocklock64 (pthread_mutex_t *mutex,
-			     clockid_t clockid,
-			     const struct __timespec64 *abstime)
+___pthread_mutex_clocklock64 (pthread_mutex_t *mutex,
+			      clockid_t clockid,
+			      const struct __timespec64 *abstime)
 {
   if (__glibc_unlikely (!futex_abstimed_supported_clockid (clockid)))
     return EINVAL;
@@ -582,39 +582,61 @@ __pthread_mutex_clocklock64 (pthread_mutex_t *mutex,
   return __pthread_mutex_clocklock_common (mutex, clockid, abstime);
 }
 
-#if __TIMESIZE != 64
-libpthread_hidden_def (__pthread_mutex_clocklock64)
+#if __TIMESIZE == 64
+strong_alias (___pthread_mutex_clocklock64, ___pthread_mutex_clocklock)
+#else /* __TIMESPEC64 != 64 */
+libc_hidden_ver (___pthread_mutex_clocklock64, __pthread_mutex_clocklock64)
 
 int
-__pthread_mutex_clocklock (pthread_mutex_t *mutex,
-			   clockid_t clockid,
-			   const struct timespec *abstime)
+___pthread_mutex_clocklock (pthread_mutex_t *mutex,
+			    clockid_t clockid,
+			    const struct timespec *abstime)
 {
   struct __timespec64 ts64 = valid_timespec_to_timespec64 (*abstime);
 
-  return __pthread_mutex_clocklock64 (mutex, clockid, &ts64);
+  return ___pthread_mutex_clocklock64 (mutex, clockid, &ts64);
 }
+#endif /* __TIMESPEC64 != 64 */
+versioned_symbol (libc, ___pthread_mutex_clocklock,
+		  __pthread_mutex_clocklock, GLIBC_PRIVATE);
+libc_hidden_ver (___pthread_mutex_clocklock, __pthread_mutex_clocklock)
+versioned_symbol (libc, ___pthread_mutex_clocklock,
+		  pthread_mutex_clocklock, GLIBC_2_34);
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_30, GLIBC_2_34)
+compat_symbol (libpthread, ___pthread_mutex_clocklock,
+	       pthread_mutex_clocklock, GLIBC_2_30);
 #endif
-weak_alias (__pthread_mutex_clocklock, pthread_mutex_clocklock)
 
 int
-__pthread_mutex_timedlock64 (pthread_mutex_t *mutex,
+___pthread_mutex_timedlock64 (pthread_mutex_t *mutex,
 			     const struct __timespec64 *abstime)
 {
   LIBC_PROBE (mutex_timedlock_entry, 2, mutex, abstime);
   return __pthread_mutex_clocklock_common (mutex, CLOCK_REALTIME, abstime);
 }
 
-#if __TIMESIZE != 64
-libpthread_hidden_def (__pthread_mutex_timedlock64)
+#if __TIMESIZE == 64
+strong_alias (___pthread_mutex_timedlock64, ___pthread_mutex_timedlock)
+#else /* __TIMESPEC64 != 64 */
+versioned_symbol (libc, ___pthread_mutex_timedlock64,
+		  __pthread_mutex_timedlock64, GLIBC_PRIVATE);
+libc_hidden_ver (___pthread_mutex_timedlock64, __pthread_mutex_timedlock64)
 
 int
-__pthread_mutex_timedlock (pthread_mutex_t *mutex,
+___pthread_mutex_timedlock (pthread_mutex_t *mutex,
 			   const struct timespec *abstime)
 {
   struct __timespec64 ts64 = valid_timespec_to_timespec64 (*abstime);
 
   return __pthread_mutex_timedlock64 (mutex, &ts64);
 }
+#endif /* __TIMESPEC64 != 64 */
+versioned_symbol (libc, ___pthread_mutex_timedlock,
+		  __pthread_mutex_timedlock, GLIBC_PRIVATE);
+libc_hidden_ver (___pthread_mutex_timedlock, __pthread_mutex_timedlock)
+versioned_symbol (libc, ___pthread_mutex_timedlock,
+		  pthread_mutex_timedlock, GLIBC_2_34);
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_34)
+compat_symbol (libpthread, ___pthread_mutex_timedlock,
+	       pthread_mutex_timedlock, GLIBC_2_2);
 #endif
-weak_alias (__pthread_mutex_timedlock, pthread_mutex_timedlock)