about summary refs log tree commit diff
path: root/sysdeps/pthread
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/pthread')
-rw-r--r--sysdeps/pthread/Makefile3
-rw-r--r--sysdeps/pthread/thrd_create.c11
2 files changed, 11 insertions, 3 deletions
diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile
index b15d085f51..bca642f438 100644
--- a/sysdeps/pthread/Makefile
+++ b/sysdeps/pthread/Makefile
@@ -31,8 +31,6 @@ headers += threads.h
 
 routines += thrd_current thrd_equal thrd_sleep thrd_yield
 
-libpthread-routines += thrd_create
-
 $(libpthread-routines-var) += \
   call_once \
   cnd_broadcast \
@@ -47,6 +45,7 @@ $(libpthread-routines-var) += \
   mtx_timedlock \
   mtx_trylock \
   mtx_unlock \
+  thrd_create \
   thrd_detach \
   thrd_exit \
   thrd_join \
diff --git a/sysdeps/pthread/thrd_create.c b/sysdeps/pthread/thrd_create.c
index 07848c0aab..3cb9f1cefb 100644
--- a/sysdeps/pthread/thrd_create.c
+++ b/sysdeps/pthread/thrd_create.c
@@ -17,9 +17,10 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include "thrd_priv.h"
+#include <shlib-compat.h>
 
 int
-thrd_create (thrd_t *thr, thrd_start_t func, void *arg)
+__thrd_create (thrd_t *thr, thrd_start_t func, void *arg)
 {
   _Static_assert (sizeof (thrd_t) == sizeof (pthread_t),
 		  "sizeof (thrd_t) != sizeof (pthread_t)");
@@ -28,3 +29,11 @@ thrd_create (thrd_t *thr, thrd_start_t func, void *arg)
 				   (void* (*) (void*))func, arg);
   return thrd_err_map (err_code);
 }
+#if PTHREAD_IN_LIBC
+versioned_symbol (libc, __thrd_create, thrd_create, GLIBC_2_34);
+# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
+compat_symbol (libc, __thrd_create, thrd_create, GLIBC_2_28);
+# endif
+#else /* !PTHREAD_IN_LIBC */
+strong_alias (__thrd_create, thrd_create)
+#endif