@@ -51,7 +51,6 @@ libpthread-routines := \
pt-sigmask \
pt-spin-inlines \
pt-cleanup \
- pt-setcancelstate \
pt-setcanceltype \
pt-testcancel \
pt-cancel \
@@ -210,6 +209,7 @@ routines := \
pt-nthreads \
pt-pthread_self \
pt-self pt-equal \
+ pt-setcancelstate \
pt-setschedparam \
# routines
shared-only-routines = forward
@@ -26,6 +26,7 @@ libc {
pthread_attr_setscope;
pthread_attr_setschedparam;
pthread_attr_init;
+ pthread_setcancelstate;
}
GLIBC_2.21 {
@@ -82,6 +83,7 @@ libc {
__pthread_attr_setstacksize;
__pthread_attr_setstackaddr;
__pthread_attr_setstack;
+ __pthread_setcancelstate;
}
}
@@ -159,7 +161,7 @@ libpthread {
pthread_rwlockattr_destroy; pthread_rwlockattr_getpshared;
pthread_rwlockattr_init; pthread_rwlockattr_setpshared;
- pthread_setcancelstate; pthread_setcanceltype;
+ pthread_setcanceltype;
pthread_setconcurrency;
pthread_setschedprio; pthread_setspecific;
@@ -84,10 +84,6 @@ FORWARD (pthread_mutex_lock, (pthread_mutex_t *mutex), (mutex), 0)
FORWARD (pthread_mutex_unlock, (pthread_mutex_t *mutex), (mutex), 0)
-FORWARD (__pthread_setcancelstate, (int state, int *oldstate),
- (state, oldstate), 0)
-strong_alias (__pthread_setcancelstate, pthread_setcancelstate);
-
FORWARD (pthread_setcanceltype, (int type, int *oldtype), (type, oldtype), 0)
FORWARD2 (__pthread_get_cleanup_stack, struct __pthread_cancelation_handler **,
@@ -41,7 +41,6 @@ static const struct pthread_functions pthread_functions = {
.ptr_pthread_mutex_lock = __pthread_mutex_lock,
.ptr_pthread_mutex_trylock = __pthread_mutex_trylock,
.ptr_pthread_mutex_unlock = __pthread_mutex_unlock,
- .ptr___pthread_setcancelstate = __pthread_setcancelstate,
.ptr_pthread_setcanceltype = __pthread_setcanceltype,
.ptr___pthread_get_cleanup_stack = __pthread_get_cleanup_stack,
.ptr_pthread_once = __pthread_once,
@@ -17,7 +17,7 @@
<https://www.gnu.org/licenses/>. */
#include <pthread.h>
-
+#include <shlib-compat.h>
#include <pt-internal.h>
int
@@ -42,5 +42,9 @@ __pthread_setcancelstate (int state, int *oldstate)
return 0;
}
+libc_hidden_def (__pthread_setcancelstate)
+versioned_symbol (libc, __pthread_setcancelstate, pthread_setcancelstate, GLIBC_2_21);
-weak_alias (__pthread_setcancelstate, pthread_setcancelstate);
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21)
+compat_symbol (libc, __pthread_setcancelstate, pthread_setcancelstate, GLIBC_2_12);
+#endif
@@ -113,7 +113,8 @@ extern int __pthread_atfork (void (*__prepare) (void),
void (*__parent) (void),
void (*__child) (void));
-
+extern int __pthread_setcancelstate (int state, int *oldstate);
+libc_hidden_proto (__pthread_setcancelstate)
/* Make the pthread functions weak so that we can elide them from
single-threaded processes. */
@@ -140,7 +141,6 @@ weak_extern (__pthread_getspecific)
weak_extern (__pthread_once)
weak_extern (__pthread_initialize)
weak_extern (__pthread_atfork)
-weak_extern (__pthread_setcancelstate)
# else
# pragma weak __pthread_mutex_init
# pragma weak __pthread_mutex_destroy
@@ -162,7 +162,6 @@ weak_extern (__pthread_setcancelstate)
# pragma weak __pthread_once
# pragma weak __pthread_initialize
# pragma weak __pthread_atfork
-# pragma weak __pthread_setcancelstate
# endif
#endif
@@ -38,7 +38,6 @@ int _pthread_mutex_init (pthread_mutex_t *,
int __pthread_mutex_lock (pthread_mutex_t *);
int __pthread_mutex_trylock (pthread_mutex_t *);
int __pthread_mutex_unlock (pthread_mutex_t *);
-int __pthread_setcancelstate (int, int *);
int __pthread_setcanceltype (int, int *);
struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void);
int __pthread_once (pthread_once_t *, void (*) (void));
@@ -75,7 +74,6 @@ struct pthread_functions
int (*ptr_pthread_mutex_lock) (pthread_mutex_t *);
int (*ptr_pthread_mutex_trylock) (pthread_mutex_t *);
int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *);
- int (*ptr___pthread_setcancelstate) (int, int *);
int (*ptr_pthread_setcanceltype) (int, int *);
struct __pthread_cancelation_handler **(*ptr___pthread_get_cleanup_stack) (void);
int (*ptr_pthread_once) (pthread_once_t *, void (*) (void));
@@ -77,9 +77,6 @@ void *__pthread_getspecific (pthread_key_t key);
int __pthread_setspecific (pthread_key_t key, const void *value);
int __pthread_key_delete (pthread_key_t key);
int __pthread_once (pthread_once_t *once_control, void (*init_routine) (void));
-
-int __pthread_setcancelstate (int state, int *oldstate);
-
int __pthread_getattr_np (pthread_t, pthread_attr_t *);
int __pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr,
void **__restrict __stackaddr);
@@ -52,6 +52,7 @@ GLIBC_2.12 pthread_attr_setstacksize F
GLIBC_2.12 pthread_equal F
GLIBC_2.12 pthread_getschedparam F
GLIBC_2.12 pthread_self F
+GLIBC_2.12 pthread_setcancelstate F
GLIBC_2.12 pthread_setschedparam F
GLIBC_2.13 __fentry__ F
GLIBC_2.14 syncfs F
@@ -86,7 +86,6 @@ GLIBC_2.12 pthread_rwlockattr_destroy F
GLIBC_2.12 pthread_rwlockattr_getpshared F
GLIBC_2.12 pthread_rwlockattr_init F
GLIBC_2.12 pthread_rwlockattr_setpshared F
-GLIBC_2.12 pthread_setcancelstate F
GLIBC_2.12 pthread_setcanceltype F
GLIBC_2.12 pthread_setconcurrency F
GLIBC_2.12 pthread_setschedprio F
@@ -116,7 +116,6 @@ GLIBC_2.38 pthread_rwlockattr_destroy F
GLIBC_2.38 pthread_rwlockattr_getpshared F
GLIBC_2.38 pthread_rwlockattr_init F
GLIBC_2.38 pthread_rwlockattr_setpshared F
-GLIBC_2.38 pthread_setcancelstate F
GLIBC_2.38 pthread_setcanceltype F
GLIBC_2.38 pthread_setconcurrency F
GLIBC_2.38 pthread_setschedprio F