diff mbox series

[v3,16/37] nptl: Move pthread_setcancelstate into libc

Message ID 37028d02f6589d0b3bb6f9c8bdeef721e2d557c8.1615914632.git.fweimer@redhat.com
State Superseded
Delegated to: Adhemerval Zanella Netto
Headers show
Series libpthread removal: NPTL forwarders are gone | expand

Commit Message

Florian Weimer March 16, 2021, 5:29 p.m. UTC
No new symbol version is required because there was a forwarder.

The symbol has been moved using scripts/move-symbol-to-libc.py.
---
 libio/iopopen.c                               |  5 ++---
 misc/error.c                                  | 19 ++++++-------------
 nptl/Makefile                                 |  2 +-
 nptl/Versions                                 |  2 +-
 nptl/forward.c                                |  4 ----
 nptl/nptl-init.c                              |  1 -
 nptl/pthreadP.h                               |  2 --
 nptl/pthread_setcancelstate.c                 |  6 +++---
 stdlib/fmtmsg.c                               |  9 ++-------
 sysdeps/nptl/libc-lockP.h                     |  4 +---
 sysdeps/nptl/pthread-functions.h              |  1 -
 sysdeps/posix/system.c                        |  5 ++---
 .../sysv/linux/aarch64/libpthread.abilist     |  1 -
 .../unix/sysv/linux/alpha/libpthread.abilist  |  1 -
 .../unix/sysv/linux/arc/libpthread.abilist    |  1 -
 .../unix/sysv/linux/arm/be/libpthread.abilist |  1 -
 .../unix/sysv/linux/arm/le/libpthread.abilist |  1 -
 .../unix/sysv/linux/csky/libpthread.abilist   |  1 -
 sysdeps/unix/sysv/linux/fatal-prepare.h       |  4 +---
 .../unix/sysv/linux/hppa/libpthread.abilist   |  1 -
 .../unix/sysv/linux/i386/libpthread.abilist   |  1 -
 .../unix/sysv/linux/ia64/libpthread.abilist   |  1 -
 .../linux/m68k/coldfire/libpthread.abilist    |  1 -
 .../sysv/linux/m68k/m680x0/libpthread.abilist |  1 -
 .../linux/microblaze/be/libpthread.abilist    |  1 -
 .../linux/microblaze/le/libpthread.abilist    |  1 -
 .../sysv/linux/mips/mips32/libpthread.abilist |  1 -
 .../sysv/linux/mips/mips64/libpthread.abilist |  1 -
 .../unix/sysv/linux/nios2/libpthread.abilist  |  1 -
 .../powerpc/powerpc32/libpthread.abilist      |  1 -
 .../powerpc/powerpc64/be/libpthread.abilist   |  1 -
 .../powerpc/powerpc64/le/libpthread.abilist   |  1 -
 .../sysv/linux/riscv/rv32/libpthread.abilist  |  1 -
 .../sysv/linux/riscv/rv64/libpthread.abilist  |  1 -
 .../linux/s390/s390-32/libpthread.abilist     |  1 -
 .../linux/s390/s390-64/libpthread.abilist     |  1 -
 .../unix/sysv/linux/sh/be/libpthread.abilist  |  1 -
 .../unix/sysv/linux/sh/le/libpthread.abilist  |  1 -
 .../linux/sparc/sparc32/libpthread.abilist    |  1 -
 .../linux/sparc/sparc64/libpthread.abilist    |  1 -
 sysdeps/unix/sysv/linux/spawni.c              |  5 ++---
 .../sysv/linux/x86_64/64/libpthread.abilist   |  1 -
 .../sysv/linux/x86_64/x32/libpthread.abilist  |  1 -
 43 files changed, 21 insertions(+), 77 deletions(-)

Comments

Adhemerval Zanella March 18, 2021, 12:52 p.m. UTC | #1
On 16/03/2021 14:29, Florian Weimer via Libc-alpha wrote:
> No new symbol version is required because there was a forwarder.
> 
> The symbol has been moved using scripts/move-symbol-to-libc.py.

LGTM.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  libio/iopopen.c                               |  5 ++---
>  misc/error.c                                  | 19 ++++++-------------
>  nptl/Makefile                                 |  2 +-
>  nptl/Versions                                 |  2 +-
>  nptl/forward.c                                |  4 ----
>  nptl/nptl-init.c                              |  1 -
>  nptl/pthreadP.h                               |  2 --
>  nptl/pthread_setcancelstate.c                 |  6 +++---
>  stdlib/fmtmsg.c                               |  9 ++-------
>  sysdeps/nptl/libc-lockP.h                     |  4 +---
>  sysdeps/nptl/pthread-functions.h              |  1 -
>  sysdeps/posix/system.c                        |  5 ++---
>  .../sysv/linux/aarch64/libpthread.abilist     |  1 -
>  .../unix/sysv/linux/alpha/libpthread.abilist  |  1 -
>  .../unix/sysv/linux/arc/libpthread.abilist    |  1 -
>  .../unix/sysv/linux/arm/be/libpthread.abilist |  1 -
>  .../unix/sysv/linux/arm/le/libpthread.abilist |  1 -
>  .../unix/sysv/linux/csky/libpthread.abilist   |  1 -
>  sysdeps/unix/sysv/linux/fatal-prepare.h       |  4 +---
>  .../unix/sysv/linux/hppa/libpthread.abilist   |  1 -
>  .../unix/sysv/linux/i386/libpthread.abilist   |  1 -
>  .../unix/sysv/linux/ia64/libpthread.abilist   |  1 -
>  .../linux/m68k/coldfire/libpthread.abilist    |  1 -
>  .../sysv/linux/m68k/m680x0/libpthread.abilist |  1 -
>  .../linux/microblaze/be/libpthread.abilist    |  1 -
>  .../linux/microblaze/le/libpthread.abilist    |  1 -
>  .../sysv/linux/mips/mips32/libpthread.abilist |  1 -
>  .../sysv/linux/mips/mips64/libpthread.abilist |  1 -
>  .../unix/sysv/linux/nios2/libpthread.abilist  |  1 -
>  .../powerpc/powerpc32/libpthread.abilist      |  1 -
>  .../powerpc/powerpc64/be/libpthread.abilist   |  1 -
>  .../powerpc/powerpc64/le/libpthread.abilist   |  1 -
>  .../sysv/linux/riscv/rv32/libpthread.abilist  |  1 -
>  .../sysv/linux/riscv/rv64/libpthread.abilist  |  1 -
>  .../linux/s390/s390-32/libpthread.abilist     |  1 -
>  .../linux/s390/s390-64/libpthread.abilist     |  1 -
>  .../unix/sysv/linux/sh/be/libpthread.abilist  |  1 -
>  .../unix/sysv/linux/sh/le/libpthread.abilist  |  1 -
>  .../linux/sparc/sparc32/libpthread.abilist    |  1 -
>  .../linux/sparc/sparc64/libpthread.abilist    |  1 -
>  sysdeps/unix/sysv/linux/spawni.c              |  5 ++---
>  .../sysv/linux/x86_64/64/libpthread.abilist   |  1 -
>  .../sysv/linux/x86_64/x32/libpthread.abilist  |  1 -
>  43 files changed, 21 insertions(+), 77 deletions(-)
> 
> diff --git a/libio/iopopen.c b/libio/iopopen.c
> index 3afca7e173..6b04222c24 100644
> --- a/libio/iopopen.c
> +++ b/libio/iopopen.c
> @@ -282,10 +282,9 @@ _IO_new_proc_close (FILE *fp)
>    do
>      {
>        int state;
> -      __libc_ptf_call (__pthread_setcancelstate,
> -		       (PTHREAD_CANCEL_DISABLE, &state), 0);
> +      __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
>        wait_pid = __waitpid (((_IO_proc_file *) fp)->pid, &wstatus, 0);
> -      __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
> +      __pthread_setcancelstate (state, NULL);
>      }
>    while (wait_pid == -1 && errno == EINTR);
>    if (wait_pid == -1)

Ok.

> diff --git a/misc/error.c b/misc/error.c
> index 06cc4a5028..0400c84df8 100644
> --- a/misc/error.c
> +++ b/misc/error.c
> @@ -236,12 +236,11 @@ void
>  __error_internal (int status, int errnum, const char *message,
>  		  va_list args, unsigned int mode_flags)
>  {
> -#if defined _LIBC && defined __libc_ptf_call
> +#if defined _LIBC
>    /* We do not want this call to be cut short by a thread
>       cancellation.  Therefore disable cancellation for now.  */
>    int state = PTHREAD_CANCEL_ENABLE;
> -  __libc_ptf_call (__pthread_setcancelstate,
> -		   (PTHREAD_CANCEL_DISABLE, &state), 0);
> +  __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
>  #endif
>  
>    flush_stdout ();

Ok.

> @@ -263,9 +262,7 @@ __error_internal (int status, int errnum, const char *message,
>  
>  #ifdef _LIBC
>    _IO_funlockfile (stderr);
> -# ifdef __libc_ptf_call
> -  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
> -# endif
> +  __pthread_setcancelstate (state, NULL);
>  #endif
>  }
>  
> @@ -305,13 +302,11 @@ __error_at_line_internal (int status, int errnum, const char *file_name,
>        old_line_number = line_number;
>      }
>  
> -#if defined _LIBC && defined __libc_ptf_call
> +#if defined _LIBC
>    /* We do not want this call to be cut short by a thread
>       cancellation.  Therefore disable cancellation for now.  */
>    int state = PTHREAD_CANCEL_ENABLE;
> -  __libc_ptf_call (__pthread_setcancelstate,
> -		   (PTHREAD_CANCEL_DISABLE, &state),
> -		   0);
> +  __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
>  #endif
>  
>    flush_stdout ();

Ok.

> @@ -341,9 +336,7 @@ __error_at_line_internal (int status, int errnum, const char *file_name,
>  
>  #ifdef _LIBC
>    _IO_funlockfile (stderr);
> -# ifdef __libc_ptf_call
> -  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
> -# endif
> +  __pthread_setcancelstate (state, NULL);
>  #endif
>  }
>  

Ok.

> diff --git a/nptl/Makefile b/nptl/Makefile
> index 2b184846ec..fc0c5a405b 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -82,6 +82,7 @@ routines = \
>    pthread_mutex_consistent \
>    pthread_once \
>    pthread_self \
> +  pthread_setcancelstate \
>    pthread_setschedparam \
>    pthread_sigmask \
>    unwind \
> @@ -203,7 +204,6 @@ libpthread-routines = \
>    pthread_rwlockattr_setpshared \
>    pthread_setaffinity \
>    pthread_setattr_default_np \
> -  pthread_setcancelstate \
>    pthread_setcanceltype \
>    pthread_setconcurrency \
>    pthread_setname \

Ok.

> diff --git a/nptl/Versions b/nptl/Versions
> index f8178409dd..32e7acfcae 100644
> --- a/nptl/Versions
> +++ b/nptl/Versions
> @@ -123,6 +123,7 @@ libc {
>      __pthread_force_elision;
>      __pthread_getattr_default_np;
>      __pthread_keys;
> +    __pthread_setcancelstate;
>      __pthread_unwind;
>    }
>  }
> @@ -192,7 +193,6 @@ libpthread {
>      pthread_mutexattr_getkind_np;
>      pthread_mutexattr_init;
>      pthread_mutexattr_setkind_np;
> -    pthread_setcancelstate;
>      pthread_setcanceltype;
>      pthread_setspecific;
>      pthread_sigmask;

Ok.

> diff --git a/nptl/forward.c b/nptl/forward.c
> index a4a377ba6a..ef4a17d39b 100644
> --- a/nptl/forward.c
> +++ b/nptl/forward.c
> @@ -102,8 +102,4 @@ 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)

Ok.

> diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
> index caa06f380a..e7615ffcb6 100644
> --- a/nptl/nptl-init.c
> +++ b/nptl/nptl-init.c
> @@ -85,7 +85,6 @@ static const struct pthread_functions pthread_functions =
>      .ptr_pthread_mutex_init = __pthread_mutex_init,
>      .ptr_pthread_mutex_lock = __pthread_mutex_lock,
>      .ptr_pthread_mutex_unlock = __pthread_mutex_unlock,
> -    .ptr___pthread_setcancelstate = __pthread_setcancelstate,
>      .ptr_pthread_setcanceltype = __pthread_setcanceltype,
>      .ptr___pthread_rwlock_rdlock = __pthread_rwlock_rdlock,
>      .ptr___pthread_rwlock_wrlock = __pthread_rwlock_wrlock,

Ok.

> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
> index 7d88754e67..9f07aa718b 100644
> --- a/nptl/pthreadP.h
> +++ b/nptl/pthreadP.h
> @@ -381,7 +381,6 @@ extern int __pthread_getschedparam (pthread_t thread_id, int *policy,
>  				    struct sched_param *param);
>  extern int __pthread_setschedparam (pthread_t thread_id, int policy,
>  				    const struct sched_param *param);
> -extern int __pthread_setcancelstate (int state, int *oldstate);
>  extern int __pthread_mutex_init (pthread_mutex_t *__mutex,
>  				 const pthread_mutexattr_t *__mutexattr);
>  extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex);
> @@ -554,7 +553,6 @@ hidden_proto (__pthread_rwlock_unlock)
>  hidden_proto (__pthread_key_create)
>  hidden_proto (__pthread_getspecific)
>  hidden_proto (__pthread_setspecific)
> -hidden_proto (__pthread_setcancelstate)
>  hidden_proto (__pthread_testcancel)
>  hidden_proto (__pthread_mutexattr_init)
>  hidden_proto (__pthread_mutexattr_settype)

Ok.

> diff --git a/nptl/pthread_setcancelstate.c b/nptl/pthread_setcancelstate.c
> index a0ffbd9338..e3696ca348 100644
> --- a/nptl/pthread_setcancelstate.c
> +++ b/nptl/pthread_setcancelstate.c
> @@ -19,7 +19,7 @@
>  #include <errno.h>
>  #include "pthreadP.h"
>  #include <atomic.h>
> -
> +#include <libc-lockP.h>
>  
>  int
>  __pthread_setcancelstate (int state, int *oldstate)
> @@ -67,5 +67,5 @@ __pthread_setcancelstate (int state, int *oldstate)
>  
>    return 0;
>  }
> -strong_alias (__pthread_setcancelstate, pthread_setcancelstate)
> -hidden_def (__pthread_setcancelstate)
> +libc_hidden_def (__pthread_setcancelstate)
> +weak_alias (__pthread_setcancelstate, pthread_setcancelstate)

Ok.

> diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
> index 2846d34012..428dad07ff 100644
> --- a/stdlib/fmtmsg.c
> +++ b/stdlib/fmtmsg.c
> @@ -122,13 +122,10 @@ fmtmsg (long int classification, const char *label, int severity,
>  	return MM_NOTOK;
>      }
>  
> -#ifdef __libc_ptf_call
>    /* We do not want this call to be cut short by a thread
>       cancellation.  Therefore disable cancellation for now.  */
>    int state = PTHREAD_CANCEL_ENABLE;
> -  __libc_ptf_call (__pthread_setcancelstate,
> -		   (PTHREAD_CANCEL_DISABLE, &state), 0);
> -#endif
> +  __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
>  
>    __libc_lock_lock (lock);
>  

Ok.

> @@ -197,9 +194,7 @@ fmtmsg (long int classification, const char *label, int severity,
>  
>    __libc_lock_unlock (lock);
>  
> -#ifdef __libc_ptf_call
> -  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
> -#endif
> +  __pthread_setcancelstate (state, NULL);
>  
>    return result;
>  }

Ok.

> diff --git a/sysdeps/nptl/libc-lockP.h b/sysdeps/nptl/libc-lockP.h
> index 9550bc37e4..df62ce0e61 100644
> --- a/sysdeps/nptl/libc-lockP.h
> +++ b/sysdeps/nptl/libc-lockP.h
> @@ -341,7 +341,7 @@ extern int __pthread_atfork (void (*__prepare) (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.  */
> @@ -367,7 +367,6 @@ weak_extern (__pthread_setspecific)
>  weak_extern (__pthread_getspecific)
>  weak_extern (__pthread_initialize)
>  weak_extern (__pthread_atfork)
> -weak_extern (__pthread_setcancelstate)
>  # else
>  #  pragma weak __pthread_mutex_init
>  #  pragma weak __pthread_mutex_destroy
> @@ -388,7 +387,6 @@ weak_extern (__pthread_setcancelstate)
>  #  pragma weak __pthread_getspecific
>  #  pragma weak __pthread_initialize
>  #  pragma weak __pthread_atfork
> -#  pragma weak __pthread_setcancelstate
>  # endif
>  #endif
>  

Ok.

> diff --git a/sysdeps/nptl/pthread-functions.h b/sysdeps/nptl/pthread-functions.h
> index 8f280b9c25..ca7673135d 100644
> --- a/sysdeps/nptl/pthread-functions.h
> +++ b/sysdeps/nptl/pthread-functions.h
> @@ -46,7 +46,6 @@ struct pthread_functions
>  				 const pthread_mutexattr_t *);
>    int (*ptr_pthread_mutex_lock) (pthread_mutex_t *);
>    int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *);
> -  int (*ptr___pthread_setcancelstate) (int, int *);
>    int (*ptr_pthread_setcanceltype) (int, int *);
>    int (*ptr___pthread_rwlock_rdlock) (pthread_rwlock_t *);
>    int (*ptr___pthread_rwlock_wrlock) (pthread_rwlock_t *);

Ok.

> diff --git a/sysdeps/posix/system.c b/sysdeps/posix/system.c
> index 13c0662f90..48668fb392 100644
> --- a/sysdeps/posix/system.c
> +++ b/sysdeps/posix/system.c
> @@ -82,10 +82,9 @@ cancel_handler (void *arg)
>    __kill_noerrno (args->pid, SIGKILL);
>  
>    int state;
> -  __libc_ptf_call (__pthread_setcancelstate,
> -                   (PTHREAD_CANCEL_DISABLE, &state), 0);
> +  __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
>    TEMP_FAILURE_RETRY (__waitpid (args->pid, NULL, 0));
> -  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
> +  __pthread_setcancelstate (state, NULL);
>  
>    DO_LOCK ();
>    if (SUB_REF () == 0)

Ok.

> diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
> index a5bc7c8357..047869a3a0 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
> @@ -133,7 +133,6 @@ GLIBC_2.17 pthread_rwlockattr_init F
>  GLIBC_2.17 pthread_rwlockattr_setkind_np F
>  GLIBC_2.17 pthread_rwlockattr_setpshared F
>  GLIBC_2.17 pthread_setaffinity_np F
> -GLIBC_2.17 pthread_setcancelstate F
>  GLIBC_2.17 pthread_setcanceltype F
>  GLIBC_2.17 pthread_setconcurrency F
>  GLIBC_2.17 pthread_setname_np F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
> index 5fc406b7c1..5252f34efe 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
> @@ -58,7 +58,6 @@ GLIBC_2.0 pthread_mutexattr_destroy F
>  GLIBC_2.0 pthread_mutexattr_getkind_np F
>  GLIBC_2.0 pthread_mutexattr_init F
>  GLIBC_2.0 pthread_mutexattr_setkind_np F
> -GLIBC_2.0 pthread_setcancelstate F
>  GLIBC_2.0 pthread_setcanceltype F
>  GLIBC_2.0 pthread_setspecific F
>  GLIBC_2.0 pthread_testcancel F
> diff --git a/sysdeps/unix/sysv/linux/arc/libpthread.abilist b/sysdeps/unix/sysv/linux/arc/libpthread.abilist
> index e4c31d1343..554b85d779 100644
> --- a/sysdeps/unix/sysv/linux/arc/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/arc/libpthread.abilist
> @@ -151,7 +151,6 @@ GLIBC_2.32 pthread_rwlockattr_setkind_np F
>  GLIBC_2.32 pthread_rwlockattr_setpshared F
>  GLIBC_2.32 pthread_setaffinity_np F
>  GLIBC_2.32 pthread_setattr_default_np F
> -GLIBC_2.32 pthread_setcancelstate F
>  GLIBC_2.32 pthread_setcanceltype F
>  GLIBC_2.32 pthread_setconcurrency F
>  GLIBC_2.32 pthread_setname_np F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
> index b97115fe03..bbe8d28583 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
> @@ -164,7 +164,6 @@ GLIBC_2.4 pthread_rwlockattr_init F
>  GLIBC_2.4 pthread_rwlockattr_setkind_np F
>  GLIBC_2.4 pthread_rwlockattr_setpshared F
>  GLIBC_2.4 pthread_setaffinity_np F
> -GLIBC_2.4 pthread_setcancelstate F
>  GLIBC_2.4 pthread_setcanceltype F
>  GLIBC_2.4 pthread_setconcurrency F
>  GLIBC_2.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
> index b97115fe03..bbe8d28583 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
> @@ -164,7 +164,6 @@ GLIBC_2.4 pthread_rwlockattr_init F
>  GLIBC_2.4 pthread_rwlockattr_setkind_np F
>  GLIBC_2.4 pthread_rwlockattr_setpshared F
>  GLIBC_2.4 pthread_setaffinity_np F
> -GLIBC_2.4 pthread_setcancelstate F
>  GLIBC_2.4 pthread_setcanceltype F
>  GLIBC_2.4 pthread_setconcurrency F
>  GLIBC_2.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
> index 7fb16e8387..c09b6cd6f4 100644
> --- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
> @@ -146,7 +146,6 @@ GLIBC_2.29 pthread_rwlockattr_setkind_np F
>  GLIBC_2.29 pthread_rwlockattr_setpshared F
>  GLIBC_2.29 pthread_setaffinity_np F
>  GLIBC_2.29 pthread_setattr_default_np F
> -GLIBC_2.29 pthread_setcancelstate F
>  GLIBC_2.29 pthread_setcanceltype F
>  GLIBC_2.29 pthread_setconcurrency F
>  GLIBC_2.29 pthread_setname_np F
> diff --git a/sysdeps/unix/sysv/linux/fatal-prepare.h b/sysdeps/unix/sysv/linux/fatal-prepare.h
> index ec441bdfbc..e2591c5447 100644
> --- a/sysdeps/unix/sysv/linux/fatal-prepare.h
> +++ b/sysdeps/unix/sysv/linux/fatal-prepare.h
> @@ -19,6 +19,4 @@
>  
>  /* We have to completely disable cancellation.  assert() must not be a
>     cancellation point but the implementation uses write() etc.  */
> -#define FATAL_PREPARE \
> -  __libc_ptf_call (__pthread_setcancelstate, \
> -		   (PTHREAD_CANCEL_DISABLE, NULL), 0)
> +#define FATAL_PREPARE __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, NULL)

Ok.

> diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
> index 3288c7dd84..424e2cf068 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
> @@ -121,7 +121,6 @@ GLIBC_2.2 pthread_rwlockattr_getpshared F
>  GLIBC_2.2 pthread_rwlockattr_init F
>  GLIBC_2.2 pthread_rwlockattr_setkind_np F
>  GLIBC_2.2 pthread_rwlockattr_setpshared F
> -GLIBC_2.2 pthread_setcancelstate F
>  GLIBC_2.2 pthread_setcanceltype F
>  GLIBC_2.2 pthread_setconcurrency F
>  GLIBC_2.2 pthread_setspecific F
> diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
> index 7ff0652b56..e145d86e57 100644
> --- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
> @@ -58,7 +58,6 @@ GLIBC_2.0 pthread_mutexattr_destroy F
>  GLIBC_2.0 pthread_mutexattr_getkind_np F
>  GLIBC_2.0 pthread_mutexattr_init F
>  GLIBC_2.0 pthread_mutexattr_setkind_np F
> -GLIBC_2.0 pthread_setcancelstate F
>  GLIBC_2.0 pthread_setcanceltype F
>  GLIBC_2.0 pthread_setspecific F
>  GLIBC_2.0 pthread_testcancel F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
> index f42e1d4f2f..2c131140ba 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
> @@ -121,7 +121,6 @@ GLIBC_2.2 pthread_rwlockattr_getpshared F
>  GLIBC_2.2 pthread_rwlockattr_init F
>  GLIBC_2.2 pthread_rwlockattr_setkind_np F
>  GLIBC_2.2 pthread_rwlockattr_setpshared F
> -GLIBC_2.2 pthread_setcancelstate F
>  GLIBC_2.2 pthread_setcanceltype F
>  GLIBC_2.2 pthread_setconcurrency F
>  GLIBC_2.2 pthread_setspecific F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
> index b97115fe03..bbe8d28583 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
> @@ -164,7 +164,6 @@ GLIBC_2.4 pthread_rwlockattr_init F
>  GLIBC_2.4 pthread_rwlockattr_setkind_np F
>  GLIBC_2.4 pthread_rwlockattr_setpshared F
>  GLIBC_2.4 pthread_setaffinity_np F
> -GLIBC_2.4 pthread_setcancelstate F
>  GLIBC_2.4 pthread_setcanceltype F
>  GLIBC_2.4 pthread_setconcurrency F
>  GLIBC_2.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
> index 7ff0652b56..e145d86e57 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
> @@ -58,7 +58,6 @@ GLIBC_2.0 pthread_mutexattr_destroy F
>  GLIBC_2.0 pthread_mutexattr_getkind_np F
>  GLIBC_2.0 pthread_mutexattr_init F
>  GLIBC_2.0 pthread_mutexattr_setkind_np F
> -GLIBC_2.0 pthread_setcancelstate F
>  GLIBC_2.0 pthread_setcanceltype F
>  GLIBC_2.0 pthread_setspecific F
>  GLIBC_2.0 pthread_testcancel F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
> index 58dc35e926..31d008004d 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
> @@ -135,7 +135,6 @@ GLIBC_2.18 pthread_rwlockattr_setkind_np F
>  GLIBC_2.18 pthread_rwlockattr_setpshared F
>  GLIBC_2.18 pthread_setaffinity_np F
>  GLIBC_2.18 pthread_setattr_default_np F
> -GLIBC_2.18 pthread_setcancelstate F
>  GLIBC_2.18 pthread_setcanceltype F
>  GLIBC_2.18 pthread_setconcurrency F
>  GLIBC_2.18 pthread_setname_np F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
> index 58dc35e926..31d008004d 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
> @@ -135,7 +135,6 @@ GLIBC_2.18 pthread_rwlockattr_setkind_np F
>  GLIBC_2.18 pthread_rwlockattr_setpshared F
>  GLIBC_2.18 pthread_setaffinity_np F
>  GLIBC_2.18 pthread_setattr_default_np F
> -GLIBC_2.18 pthread_setcancelstate F
>  GLIBC_2.18 pthread_setcanceltype F
>  GLIBC_2.18 pthread_setconcurrency F
>  GLIBC_2.18 pthread_setname_np F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
> index 94f17b3c53..d4bd5b5ce3 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
> @@ -58,7 +58,6 @@ GLIBC_2.0 pthread_mutexattr_destroy F
>  GLIBC_2.0 pthread_mutexattr_getkind_np F
>  GLIBC_2.0 pthread_mutexattr_init F
>  GLIBC_2.0 pthread_mutexattr_setkind_np F
> -GLIBC_2.0 pthread_setcancelstate F
>  GLIBC_2.0 pthread_setcanceltype F
>  GLIBC_2.0 pthread_setspecific F
>  GLIBC_2.0 pthread_testcancel F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> index 94f17b3c53..d4bd5b5ce3 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> @@ -58,7 +58,6 @@ GLIBC_2.0 pthread_mutexattr_destroy F
>  GLIBC_2.0 pthread_mutexattr_getkind_np F
>  GLIBC_2.0 pthread_mutexattr_init F
>  GLIBC_2.0 pthread_mutexattr_setkind_np F
> -GLIBC_2.0 pthread_setcancelstate F
>  GLIBC_2.0 pthread_setcanceltype F
>  GLIBC_2.0 pthread_setspecific F
>  GLIBC_2.0 pthread_testcancel F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
> index 2bf7ef83c6..ed8be1e44b 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
> @@ -135,7 +135,6 @@ GLIBC_2.21 pthread_rwlockattr_setkind_np F
>  GLIBC_2.21 pthread_rwlockattr_setpshared F
>  GLIBC_2.21 pthread_setaffinity_np F
>  GLIBC_2.21 pthread_setattr_default_np F
> -GLIBC_2.21 pthread_setcancelstate F
>  GLIBC_2.21 pthread_setcanceltype F
>  GLIBC_2.21 pthread_setconcurrency F
>  GLIBC_2.21 pthread_setname_np F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
> index b642ce0420..d9e3bb5b31 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
> @@ -58,7 +58,6 @@ GLIBC_2.0 pthread_mutexattr_destroy F
>  GLIBC_2.0 pthread_mutexattr_getkind_np F
>  GLIBC_2.0 pthread_mutexattr_init F
>  GLIBC_2.0 pthread_mutexattr_setkind_np F
> -GLIBC_2.0 pthread_setcancelstate F
>  GLIBC_2.0 pthread_setcanceltype F
>  GLIBC_2.0 pthread_setspecific F
>  GLIBC_2.0 pthread_testcancel F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
> index ba4b580173..8f393575e1 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
> @@ -141,7 +141,6 @@ GLIBC_2.3 pthread_rwlockattr_getpshared F
>  GLIBC_2.3 pthread_rwlockattr_init F
>  GLIBC_2.3 pthread_rwlockattr_setkind_np F
>  GLIBC_2.3 pthread_rwlockattr_setpshared F
> -GLIBC_2.3 pthread_setcancelstate F
>  GLIBC_2.3 pthread_setcanceltype F
>  GLIBC_2.3 pthread_setconcurrency F
>  GLIBC_2.3 pthread_setspecific F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
> index a5bc7c8357..047869a3a0 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
> @@ -133,7 +133,6 @@ GLIBC_2.17 pthread_rwlockattr_init F
>  GLIBC_2.17 pthread_rwlockattr_setkind_np F
>  GLIBC_2.17 pthread_rwlockattr_setpshared F
>  GLIBC_2.17 pthread_setaffinity_np F
> -GLIBC_2.17 pthread_setcancelstate F
>  GLIBC_2.17 pthread_setcanceltype F
>  GLIBC_2.17 pthread_setconcurrency F
>  GLIBC_2.17 pthread_setname_np F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist
> index 4c2ef9c33d..528792a426 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist
> @@ -151,7 +151,6 @@ GLIBC_2.33 pthread_rwlockattr_setkind_np F
>  GLIBC_2.33 pthread_rwlockattr_setpshared F
>  GLIBC_2.33 pthread_setaffinity_np F
>  GLIBC_2.33 pthread_setattr_default_np F
> -GLIBC_2.33 pthread_setcancelstate F
>  GLIBC_2.33 pthread_setcanceltype F
>  GLIBC_2.33 pthread_setconcurrency F
>  GLIBC_2.33 pthread_setname_np F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
> index 81300bbbb4..66f871fb89 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
> @@ -135,7 +135,6 @@ GLIBC_2.27 pthread_rwlockattr_setkind_np F
>  GLIBC_2.27 pthread_rwlockattr_setpshared F
>  GLIBC_2.27 pthread_setaffinity_np F
>  GLIBC_2.27 pthread_setattr_default_np F
> -GLIBC_2.27 pthread_setcancelstate F
>  GLIBC_2.27 pthread_setcanceltype F
>  GLIBC_2.27 pthread_setconcurrency F
>  GLIBC_2.27 pthread_setname_np F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
> index d17848f0b1..e69792eba6 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
> @@ -58,7 +58,6 @@ GLIBC_2.0 pthread_mutexattr_destroy F
>  GLIBC_2.0 pthread_mutexattr_getkind_np F
>  GLIBC_2.0 pthread_mutexattr_init F
>  GLIBC_2.0 pthread_mutexattr_setkind_np F
> -GLIBC_2.0 pthread_setcancelstate F
>  GLIBC_2.0 pthread_setcanceltype F
>  GLIBC_2.0 pthread_setspecific F
>  GLIBC_2.0 pthread_testcancel F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
> index 1ae431fdf7..75c5a27854 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
> @@ -122,7 +122,6 @@ GLIBC_2.2 pthread_rwlockattr_getpshared F
>  GLIBC_2.2 pthread_rwlockattr_init F
>  GLIBC_2.2 pthread_rwlockattr_setkind_np F
>  GLIBC_2.2 pthread_rwlockattr_setpshared F
> -GLIBC_2.2 pthread_setcancelstate F
>  GLIBC_2.2 pthread_setcanceltype F
>  GLIBC_2.2 pthread_setconcurrency F
>  GLIBC_2.2 pthread_setspecific F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
> index 3288c7dd84..424e2cf068 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
> @@ -121,7 +121,6 @@ GLIBC_2.2 pthread_rwlockattr_getpshared F
>  GLIBC_2.2 pthread_rwlockattr_init F
>  GLIBC_2.2 pthread_rwlockattr_setkind_np F
>  GLIBC_2.2 pthread_rwlockattr_setpshared F
> -GLIBC_2.2 pthread_setcancelstate F
>  GLIBC_2.2 pthread_setcanceltype F
>  GLIBC_2.2 pthread_setconcurrency F
>  GLIBC_2.2 pthread_setspecific F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
> index 3288c7dd84..424e2cf068 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
> @@ -121,7 +121,6 @@ GLIBC_2.2 pthread_rwlockattr_getpshared F
>  GLIBC_2.2 pthread_rwlockattr_init F
>  GLIBC_2.2 pthread_rwlockattr_setkind_np F
>  GLIBC_2.2 pthread_rwlockattr_setpshared F
> -GLIBC_2.2 pthread_setcancelstate F
>  GLIBC_2.2 pthread_setcanceltype F
>  GLIBC_2.2 pthread_setconcurrency F
>  GLIBC_2.2 pthread_setspecific F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
> index 5fc406b7c1..5252f34efe 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
> @@ -58,7 +58,6 @@ GLIBC_2.0 pthread_mutexattr_destroy F
>  GLIBC_2.0 pthread_mutexattr_getkind_np F
>  GLIBC_2.0 pthread_mutexattr_init F
>  GLIBC_2.0 pthread_mutexattr_setkind_np F
> -GLIBC_2.0 pthread_setcancelstate F
>  GLIBC_2.0 pthread_setcanceltype F
>  GLIBC_2.0 pthread_setspecific F
>  GLIBC_2.0 pthread_testcancel F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
> index f42e1d4f2f..2c131140ba 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
> @@ -121,7 +121,6 @@ GLIBC_2.2 pthread_rwlockattr_getpshared F
>  GLIBC_2.2 pthread_rwlockattr_init F
>  GLIBC_2.2 pthread_rwlockattr_setkind_np F
>  GLIBC_2.2 pthread_rwlockattr_setpshared F
> -GLIBC_2.2 pthread_setcancelstate F
>  GLIBC_2.2 pthread_setcanceltype F
>  GLIBC_2.2 pthread_setconcurrency F
>  GLIBC_2.2 pthread_setspecific F
> diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c
> index b53b81b8fc..501f8fbccd 100644
> --- a/sysdeps/unix/sysv/linux/spawni.c
> +++ b/sysdeps/unix/sysv/linux/spawni.c
> @@ -354,8 +354,7 @@ __spawnix (pid_t * pid, const char *file,
>  
>    /* Disable asynchronous cancellation.  */
>    int state;
> -  __libc_ptf_call (__pthread_setcancelstate,
> -                   (PTHREAD_CANCEL_DISABLE, &state), 0);
> +  __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
>  
>    /* Child must set args.err to something non-negative - we rely on
>       the parent and child sharing VM.  */
> @@ -413,7 +412,7 @@ __spawnix (pid_t * pid, const char *file,
>  
>    __libc_signal_restore_set (&args.oldmask);
>  
> -  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
> +  __pthread_setcancelstate (state, NULL);
>  
>    return ec;
>  }

Ok.

> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> index 49fdd52a28..afa8bb1dd8 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> @@ -121,7 +121,6 @@ GLIBC_2.2.5 pthread_rwlockattr_getpshared F
>  GLIBC_2.2.5 pthread_rwlockattr_init F
>  GLIBC_2.2.5 pthread_rwlockattr_setkind_np F
>  GLIBC_2.2.5 pthread_rwlockattr_setpshared F
> -GLIBC_2.2.5 pthread_setcancelstate F
>  GLIBC_2.2.5 pthread_setcanceltype F
>  GLIBC_2.2.5 pthread_setconcurrency F
>  GLIBC_2.2.5 pthread_setspecific F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
> index 0384eaa51a..b8c545b9c0 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
> @@ -133,7 +133,6 @@ GLIBC_2.16 pthread_rwlockattr_init F
>  GLIBC_2.16 pthread_rwlockattr_setkind_np F
>  GLIBC_2.16 pthread_rwlockattr_setpshared F
>  GLIBC_2.16 pthread_setaffinity_np F
> -GLIBC_2.16 pthread_setcancelstate F
>  GLIBC_2.16 pthread_setcanceltype F
>  GLIBC_2.16 pthread_setconcurrency F
>  GLIBC_2.16 pthread_setname_np F
>
diff mbox series

Patch

diff --git a/libio/iopopen.c b/libio/iopopen.c
index 3afca7e173..6b04222c24 100644
--- a/libio/iopopen.c
+++ b/libio/iopopen.c
@@ -282,10 +282,9 @@  _IO_new_proc_close (FILE *fp)
   do
     {
       int state;
-      __libc_ptf_call (__pthread_setcancelstate,
-		       (PTHREAD_CANCEL_DISABLE, &state), 0);
+      __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
       wait_pid = __waitpid (((_IO_proc_file *) fp)->pid, &wstatus, 0);
-      __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
+      __pthread_setcancelstate (state, NULL);
     }
   while (wait_pid == -1 && errno == EINTR);
   if (wait_pid == -1)
diff --git a/misc/error.c b/misc/error.c
index 06cc4a5028..0400c84df8 100644
--- a/misc/error.c
+++ b/misc/error.c
@@ -236,12 +236,11 @@  void
 __error_internal (int status, int errnum, const char *message,
 		  va_list args, unsigned int mode_flags)
 {
-#if defined _LIBC && defined __libc_ptf_call
+#if defined _LIBC
   /* We do not want this call to be cut short by a thread
      cancellation.  Therefore disable cancellation for now.  */
   int state = PTHREAD_CANCEL_ENABLE;
-  __libc_ptf_call (__pthread_setcancelstate,
-		   (PTHREAD_CANCEL_DISABLE, &state), 0);
+  __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
 #endif
 
   flush_stdout ();
@@ -263,9 +262,7 @@  __error_internal (int status, int errnum, const char *message,
 
 #ifdef _LIBC
   _IO_funlockfile (stderr);
-# ifdef __libc_ptf_call
-  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
-# endif
+  __pthread_setcancelstate (state, NULL);
 #endif
 }
 
@@ -305,13 +302,11 @@  __error_at_line_internal (int status, int errnum, const char *file_name,
       old_line_number = line_number;
     }
 
-#if defined _LIBC && defined __libc_ptf_call
+#if defined _LIBC
   /* We do not want this call to be cut short by a thread
      cancellation.  Therefore disable cancellation for now.  */
   int state = PTHREAD_CANCEL_ENABLE;
-  __libc_ptf_call (__pthread_setcancelstate,
-		   (PTHREAD_CANCEL_DISABLE, &state),
-		   0);
+  __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
 #endif
 
   flush_stdout ();
@@ -341,9 +336,7 @@  __error_at_line_internal (int status, int errnum, const char *file_name,
 
 #ifdef _LIBC
   _IO_funlockfile (stderr);
-# ifdef __libc_ptf_call
-  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
-# endif
+  __pthread_setcancelstate (state, NULL);
 #endif
 }
 
diff --git a/nptl/Makefile b/nptl/Makefile
index 2b184846ec..fc0c5a405b 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -82,6 +82,7 @@  routines = \
   pthread_mutex_consistent \
   pthread_once \
   pthread_self \
+  pthread_setcancelstate \
   pthread_setschedparam \
   pthread_sigmask \
   unwind \
@@ -203,7 +204,6 @@  libpthread-routines = \
   pthread_rwlockattr_setpshared \
   pthread_setaffinity \
   pthread_setattr_default_np \
-  pthread_setcancelstate \
   pthread_setcanceltype \
   pthread_setconcurrency \
   pthread_setname \
diff --git a/nptl/Versions b/nptl/Versions
index f8178409dd..32e7acfcae 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -123,6 +123,7 @@  libc {
     __pthread_force_elision;
     __pthread_getattr_default_np;
     __pthread_keys;
+    __pthread_setcancelstate;
     __pthread_unwind;
   }
 }
@@ -192,7 +193,6 @@  libpthread {
     pthread_mutexattr_getkind_np;
     pthread_mutexattr_init;
     pthread_mutexattr_setkind_np;
-    pthread_setcancelstate;
     pthread_setcanceltype;
     pthread_setspecific;
     pthread_sigmask;
diff --git a/nptl/forward.c b/nptl/forward.c
index a4a377ba6a..ef4a17d39b 100644
--- a/nptl/forward.c
+++ b/nptl/forward.c
@@ -102,8 +102,4 @@  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)
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
index caa06f380a..e7615ffcb6 100644
--- a/nptl/nptl-init.c
+++ b/nptl/nptl-init.c
@@ -85,7 +85,6 @@  static const struct pthread_functions pthread_functions =
     .ptr_pthread_mutex_init = __pthread_mutex_init,
     .ptr_pthread_mutex_lock = __pthread_mutex_lock,
     .ptr_pthread_mutex_unlock = __pthread_mutex_unlock,
-    .ptr___pthread_setcancelstate = __pthread_setcancelstate,
     .ptr_pthread_setcanceltype = __pthread_setcanceltype,
     .ptr___pthread_rwlock_rdlock = __pthread_rwlock_rdlock,
     .ptr___pthread_rwlock_wrlock = __pthread_rwlock_wrlock,
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 7d88754e67..9f07aa718b 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -381,7 +381,6 @@  extern int __pthread_getschedparam (pthread_t thread_id, int *policy,
 				    struct sched_param *param);
 extern int __pthread_setschedparam (pthread_t thread_id, int policy,
 				    const struct sched_param *param);
-extern int __pthread_setcancelstate (int state, int *oldstate);
 extern int __pthread_mutex_init (pthread_mutex_t *__mutex,
 				 const pthread_mutexattr_t *__mutexattr);
 extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex);
@@ -554,7 +553,6 @@  hidden_proto (__pthread_rwlock_unlock)
 hidden_proto (__pthread_key_create)
 hidden_proto (__pthread_getspecific)
 hidden_proto (__pthread_setspecific)
-hidden_proto (__pthread_setcancelstate)
 hidden_proto (__pthread_testcancel)
 hidden_proto (__pthread_mutexattr_init)
 hidden_proto (__pthread_mutexattr_settype)
diff --git a/nptl/pthread_setcancelstate.c b/nptl/pthread_setcancelstate.c
index a0ffbd9338..e3696ca348 100644
--- a/nptl/pthread_setcancelstate.c
+++ b/nptl/pthread_setcancelstate.c
@@ -19,7 +19,7 @@ 
 #include <errno.h>
 #include "pthreadP.h"
 #include <atomic.h>
-
+#include <libc-lockP.h>
 
 int
 __pthread_setcancelstate (int state, int *oldstate)
@@ -67,5 +67,5 @@  __pthread_setcancelstate (int state, int *oldstate)
 
   return 0;
 }
-strong_alias (__pthread_setcancelstate, pthread_setcancelstate)
-hidden_def (__pthread_setcancelstate)
+libc_hidden_def (__pthread_setcancelstate)
+weak_alias (__pthread_setcancelstate, pthread_setcancelstate)
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 2846d34012..428dad07ff 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -122,13 +122,10 @@  fmtmsg (long int classification, const char *label, int severity,
 	return MM_NOTOK;
     }
 
-#ifdef __libc_ptf_call
   /* We do not want this call to be cut short by a thread
      cancellation.  Therefore disable cancellation for now.  */
   int state = PTHREAD_CANCEL_ENABLE;
-  __libc_ptf_call (__pthread_setcancelstate,
-		   (PTHREAD_CANCEL_DISABLE, &state), 0);
-#endif
+  __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
 
   __libc_lock_lock (lock);
 
@@ -197,9 +194,7 @@  fmtmsg (long int classification, const char *label, int severity,
 
   __libc_lock_unlock (lock);
 
-#ifdef __libc_ptf_call
-  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
-#endif
+  __pthread_setcancelstate (state, NULL);
 
   return result;
 }
diff --git a/sysdeps/nptl/libc-lockP.h b/sysdeps/nptl/libc-lockP.h
index 9550bc37e4..df62ce0e61 100644
--- a/sysdeps/nptl/libc-lockP.h
+++ b/sysdeps/nptl/libc-lockP.h
@@ -341,7 +341,7 @@  extern int __pthread_atfork (void (*__prepare) (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.  */
@@ -367,7 +367,6 @@  weak_extern (__pthread_setspecific)
 weak_extern (__pthread_getspecific)
 weak_extern (__pthread_initialize)
 weak_extern (__pthread_atfork)
-weak_extern (__pthread_setcancelstate)
 # else
 #  pragma weak __pthread_mutex_init
 #  pragma weak __pthread_mutex_destroy
@@ -388,7 +387,6 @@  weak_extern (__pthread_setcancelstate)
 #  pragma weak __pthread_getspecific
 #  pragma weak __pthread_initialize
 #  pragma weak __pthread_atfork
-#  pragma weak __pthread_setcancelstate
 # endif
 #endif
 
diff --git a/sysdeps/nptl/pthread-functions.h b/sysdeps/nptl/pthread-functions.h
index 8f280b9c25..ca7673135d 100644
--- a/sysdeps/nptl/pthread-functions.h
+++ b/sysdeps/nptl/pthread-functions.h
@@ -46,7 +46,6 @@  struct pthread_functions
 				 const pthread_mutexattr_t *);
   int (*ptr_pthread_mutex_lock) (pthread_mutex_t *);
   int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *);
-  int (*ptr___pthread_setcancelstate) (int, int *);
   int (*ptr_pthread_setcanceltype) (int, int *);
   int (*ptr___pthread_rwlock_rdlock) (pthread_rwlock_t *);
   int (*ptr___pthread_rwlock_wrlock) (pthread_rwlock_t *);
diff --git a/sysdeps/posix/system.c b/sysdeps/posix/system.c
index 13c0662f90..48668fb392 100644
--- a/sysdeps/posix/system.c
+++ b/sysdeps/posix/system.c
@@ -82,10 +82,9 @@  cancel_handler (void *arg)
   __kill_noerrno (args->pid, SIGKILL);
 
   int state;
-  __libc_ptf_call (__pthread_setcancelstate,
-                   (PTHREAD_CANCEL_DISABLE, &state), 0);
+  __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
   TEMP_FAILURE_RETRY (__waitpid (args->pid, NULL, 0));
-  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
+  __pthread_setcancelstate (state, NULL);
 
   DO_LOCK ();
   if (SUB_REF () == 0)
diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
index a5bc7c8357..047869a3a0 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
@@ -133,7 +133,6 @@  GLIBC_2.17 pthread_rwlockattr_init F
 GLIBC_2.17 pthread_rwlockattr_setkind_np F
 GLIBC_2.17 pthread_rwlockattr_setpshared F
 GLIBC_2.17 pthread_setaffinity_np F
-GLIBC_2.17 pthread_setcancelstate F
 GLIBC_2.17 pthread_setcanceltype F
 GLIBC_2.17 pthread_setconcurrency F
 GLIBC_2.17 pthread_setname_np F
diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
index 5fc406b7c1..5252f34efe 100644
--- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
@@ -58,7 +58,6 @@  GLIBC_2.0 pthread_mutexattr_destroy F
 GLIBC_2.0 pthread_mutexattr_getkind_np F
 GLIBC_2.0 pthread_mutexattr_init F
 GLIBC_2.0 pthread_mutexattr_setkind_np F
-GLIBC_2.0 pthread_setcancelstate F
 GLIBC_2.0 pthread_setcanceltype F
 GLIBC_2.0 pthread_setspecific F
 GLIBC_2.0 pthread_testcancel F
diff --git a/sysdeps/unix/sysv/linux/arc/libpthread.abilist b/sysdeps/unix/sysv/linux/arc/libpthread.abilist
index e4c31d1343..554b85d779 100644
--- a/sysdeps/unix/sysv/linux/arc/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libpthread.abilist
@@ -151,7 +151,6 @@  GLIBC_2.32 pthread_rwlockattr_setkind_np F
 GLIBC_2.32 pthread_rwlockattr_setpshared F
 GLIBC_2.32 pthread_setaffinity_np F
 GLIBC_2.32 pthread_setattr_default_np F
-GLIBC_2.32 pthread_setcancelstate F
 GLIBC_2.32 pthread_setcanceltype F
 GLIBC_2.32 pthread_setconcurrency F
 GLIBC_2.32 pthread_setname_np F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
index b97115fe03..bbe8d28583 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
@@ -164,7 +164,6 @@  GLIBC_2.4 pthread_rwlockattr_init F
 GLIBC_2.4 pthread_rwlockattr_setkind_np F
 GLIBC_2.4 pthread_rwlockattr_setpshared F
 GLIBC_2.4 pthread_setaffinity_np F
-GLIBC_2.4 pthread_setcancelstate F
 GLIBC_2.4 pthread_setcanceltype F
 GLIBC_2.4 pthread_setconcurrency F
 GLIBC_2.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
index b97115fe03..bbe8d28583 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
@@ -164,7 +164,6 @@  GLIBC_2.4 pthread_rwlockattr_init F
 GLIBC_2.4 pthread_rwlockattr_setkind_np F
 GLIBC_2.4 pthread_rwlockattr_setpshared F
 GLIBC_2.4 pthread_setaffinity_np F
-GLIBC_2.4 pthread_setcancelstate F
 GLIBC_2.4 pthread_setcanceltype F
 GLIBC_2.4 pthread_setconcurrency F
 GLIBC_2.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
index 7fb16e8387..c09b6cd6f4 100644
--- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
@@ -146,7 +146,6 @@  GLIBC_2.29 pthread_rwlockattr_setkind_np F
 GLIBC_2.29 pthread_rwlockattr_setpshared F
 GLIBC_2.29 pthread_setaffinity_np F
 GLIBC_2.29 pthread_setattr_default_np F
-GLIBC_2.29 pthread_setcancelstate F
 GLIBC_2.29 pthread_setcanceltype F
 GLIBC_2.29 pthread_setconcurrency F
 GLIBC_2.29 pthread_setname_np F
diff --git a/sysdeps/unix/sysv/linux/fatal-prepare.h b/sysdeps/unix/sysv/linux/fatal-prepare.h
index ec441bdfbc..e2591c5447 100644
--- a/sysdeps/unix/sysv/linux/fatal-prepare.h
+++ b/sysdeps/unix/sysv/linux/fatal-prepare.h
@@ -19,6 +19,4 @@ 
 
 /* We have to completely disable cancellation.  assert() must not be a
    cancellation point but the implementation uses write() etc.  */
-#define FATAL_PREPARE \
-  __libc_ptf_call (__pthread_setcancelstate, \
-		   (PTHREAD_CANCEL_DISABLE, NULL), 0)
+#define FATAL_PREPARE __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, NULL)
diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
index 3288c7dd84..424e2cf068 100644
--- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
@@ -121,7 +121,6 @@  GLIBC_2.2 pthread_rwlockattr_getpshared F
 GLIBC_2.2 pthread_rwlockattr_init F
 GLIBC_2.2 pthread_rwlockattr_setkind_np F
 GLIBC_2.2 pthread_rwlockattr_setpshared F
-GLIBC_2.2 pthread_setcancelstate F
 GLIBC_2.2 pthread_setcanceltype F
 GLIBC_2.2 pthread_setconcurrency F
 GLIBC_2.2 pthread_setspecific F
diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
index 7ff0652b56..e145d86e57 100644
--- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
@@ -58,7 +58,6 @@  GLIBC_2.0 pthread_mutexattr_destroy F
 GLIBC_2.0 pthread_mutexattr_getkind_np F
 GLIBC_2.0 pthread_mutexattr_init F
 GLIBC_2.0 pthread_mutexattr_setkind_np F
-GLIBC_2.0 pthread_setcancelstate F
 GLIBC_2.0 pthread_setcanceltype F
 GLIBC_2.0 pthread_setspecific F
 GLIBC_2.0 pthread_testcancel F
diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
index f42e1d4f2f..2c131140ba 100644
--- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
@@ -121,7 +121,6 @@  GLIBC_2.2 pthread_rwlockattr_getpshared F
 GLIBC_2.2 pthread_rwlockattr_init F
 GLIBC_2.2 pthread_rwlockattr_setkind_np F
 GLIBC_2.2 pthread_rwlockattr_setpshared F
-GLIBC_2.2 pthread_setcancelstate F
 GLIBC_2.2 pthread_setcanceltype F
 GLIBC_2.2 pthread_setconcurrency F
 GLIBC_2.2 pthread_setspecific F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
index b97115fe03..bbe8d28583 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
@@ -164,7 +164,6 @@  GLIBC_2.4 pthread_rwlockattr_init F
 GLIBC_2.4 pthread_rwlockattr_setkind_np F
 GLIBC_2.4 pthread_rwlockattr_setpshared F
 GLIBC_2.4 pthread_setaffinity_np F
-GLIBC_2.4 pthread_setcancelstate F
 GLIBC_2.4 pthread_setcanceltype F
 GLIBC_2.4 pthread_setconcurrency F
 GLIBC_2.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
index 7ff0652b56..e145d86e57 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
@@ -58,7 +58,6 @@  GLIBC_2.0 pthread_mutexattr_destroy F
 GLIBC_2.0 pthread_mutexattr_getkind_np F
 GLIBC_2.0 pthread_mutexattr_init F
 GLIBC_2.0 pthread_mutexattr_setkind_np F
-GLIBC_2.0 pthread_setcancelstate F
 GLIBC_2.0 pthread_setcanceltype F
 GLIBC_2.0 pthread_setspecific F
 GLIBC_2.0 pthread_testcancel F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
index 58dc35e926..31d008004d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
@@ -135,7 +135,6 @@  GLIBC_2.18 pthread_rwlockattr_setkind_np F
 GLIBC_2.18 pthread_rwlockattr_setpshared F
 GLIBC_2.18 pthread_setaffinity_np F
 GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.18 pthread_setcancelstate F
 GLIBC_2.18 pthread_setcanceltype F
 GLIBC_2.18 pthread_setconcurrency F
 GLIBC_2.18 pthread_setname_np F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
index 58dc35e926..31d008004d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
@@ -135,7 +135,6 @@  GLIBC_2.18 pthread_rwlockattr_setkind_np F
 GLIBC_2.18 pthread_rwlockattr_setpshared F
 GLIBC_2.18 pthread_setaffinity_np F
 GLIBC_2.18 pthread_setattr_default_np F
-GLIBC_2.18 pthread_setcancelstate F
 GLIBC_2.18 pthread_setcanceltype F
 GLIBC_2.18 pthread_setconcurrency F
 GLIBC_2.18 pthread_setname_np F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
index 94f17b3c53..d4bd5b5ce3 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
@@ -58,7 +58,6 @@  GLIBC_2.0 pthread_mutexattr_destroy F
 GLIBC_2.0 pthread_mutexattr_getkind_np F
 GLIBC_2.0 pthread_mutexattr_init F
 GLIBC_2.0 pthread_mutexattr_setkind_np F
-GLIBC_2.0 pthread_setcancelstate F
 GLIBC_2.0 pthread_setcanceltype F
 GLIBC_2.0 pthread_setspecific F
 GLIBC_2.0 pthread_testcancel F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
index 94f17b3c53..d4bd5b5ce3 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
@@ -58,7 +58,6 @@  GLIBC_2.0 pthread_mutexattr_destroy F
 GLIBC_2.0 pthread_mutexattr_getkind_np F
 GLIBC_2.0 pthread_mutexattr_init F
 GLIBC_2.0 pthread_mutexattr_setkind_np F
-GLIBC_2.0 pthread_setcancelstate F
 GLIBC_2.0 pthread_setcanceltype F
 GLIBC_2.0 pthread_setspecific F
 GLIBC_2.0 pthread_testcancel F
diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
index 2bf7ef83c6..ed8be1e44b 100644
--- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
@@ -135,7 +135,6 @@  GLIBC_2.21 pthread_rwlockattr_setkind_np F
 GLIBC_2.21 pthread_rwlockattr_setpshared F
 GLIBC_2.21 pthread_setaffinity_np F
 GLIBC_2.21 pthread_setattr_default_np F
-GLIBC_2.21 pthread_setcancelstate F
 GLIBC_2.21 pthread_setcanceltype F
 GLIBC_2.21 pthread_setconcurrency F
 GLIBC_2.21 pthread_setname_np F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
index b642ce0420..d9e3bb5b31 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
@@ -58,7 +58,6 @@  GLIBC_2.0 pthread_mutexattr_destroy F
 GLIBC_2.0 pthread_mutexattr_getkind_np F
 GLIBC_2.0 pthread_mutexattr_init F
 GLIBC_2.0 pthread_mutexattr_setkind_np F
-GLIBC_2.0 pthread_setcancelstate F
 GLIBC_2.0 pthread_setcanceltype F
 GLIBC_2.0 pthread_setspecific F
 GLIBC_2.0 pthread_testcancel F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
index ba4b580173..8f393575e1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
@@ -141,7 +141,6 @@  GLIBC_2.3 pthread_rwlockattr_getpshared F
 GLIBC_2.3 pthread_rwlockattr_init F
 GLIBC_2.3 pthread_rwlockattr_setkind_np F
 GLIBC_2.3 pthread_rwlockattr_setpshared F
-GLIBC_2.3 pthread_setcancelstate F
 GLIBC_2.3 pthread_setcanceltype F
 GLIBC_2.3 pthread_setconcurrency F
 GLIBC_2.3 pthread_setspecific F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
index a5bc7c8357..047869a3a0 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
@@ -133,7 +133,6 @@  GLIBC_2.17 pthread_rwlockattr_init F
 GLIBC_2.17 pthread_rwlockattr_setkind_np F
 GLIBC_2.17 pthread_rwlockattr_setpshared F
 GLIBC_2.17 pthread_setaffinity_np F
-GLIBC_2.17 pthread_setcancelstate F
 GLIBC_2.17 pthread_setcanceltype F
 GLIBC_2.17 pthread_setconcurrency F
 GLIBC_2.17 pthread_setname_np F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist
index 4c2ef9c33d..528792a426 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist
@@ -151,7 +151,6 @@  GLIBC_2.33 pthread_rwlockattr_setkind_np F
 GLIBC_2.33 pthread_rwlockattr_setpshared F
 GLIBC_2.33 pthread_setaffinity_np F
 GLIBC_2.33 pthread_setattr_default_np F
-GLIBC_2.33 pthread_setcancelstate F
 GLIBC_2.33 pthread_setcanceltype F
 GLIBC_2.33 pthread_setconcurrency F
 GLIBC_2.33 pthread_setname_np F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
index 81300bbbb4..66f871fb89 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
@@ -135,7 +135,6 @@  GLIBC_2.27 pthread_rwlockattr_setkind_np F
 GLIBC_2.27 pthread_rwlockattr_setpshared F
 GLIBC_2.27 pthread_setaffinity_np F
 GLIBC_2.27 pthread_setattr_default_np F
-GLIBC_2.27 pthread_setcancelstate F
 GLIBC_2.27 pthread_setcanceltype F
 GLIBC_2.27 pthread_setconcurrency F
 GLIBC_2.27 pthread_setname_np F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
index d17848f0b1..e69792eba6 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
@@ -58,7 +58,6 @@  GLIBC_2.0 pthread_mutexattr_destroy F
 GLIBC_2.0 pthread_mutexattr_getkind_np F
 GLIBC_2.0 pthread_mutexattr_init F
 GLIBC_2.0 pthread_mutexattr_setkind_np F
-GLIBC_2.0 pthread_setcancelstate F
 GLIBC_2.0 pthread_setcanceltype F
 GLIBC_2.0 pthread_setspecific F
 GLIBC_2.0 pthread_testcancel F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
index 1ae431fdf7..75c5a27854 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
@@ -122,7 +122,6 @@  GLIBC_2.2 pthread_rwlockattr_getpshared F
 GLIBC_2.2 pthread_rwlockattr_init F
 GLIBC_2.2 pthread_rwlockattr_setkind_np F
 GLIBC_2.2 pthread_rwlockattr_setpshared F
-GLIBC_2.2 pthread_setcancelstate F
 GLIBC_2.2 pthread_setcanceltype F
 GLIBC_2.2 pthread_setconcurrency F
 GLIBC_2.2 pthread_setspecific F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
index 3288c7dd84..424e2cf068 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
@@ -121,7 +121,6 @@  GLIBC_2.2 pthread_rwlockattr_getpshared F
 GLIBC_2.2 pthread_rwlockattr_init F
 GLIBC_2.2 pthread_rwlockattr_setkind_np F
 GLIBC_2.2 pthread_rwlockattr_setpshared F
-GLIBC_2.2 pthread_setcancelstate F
 GLIBC_2.2 pthread_setcanceltype F
 GLIBC_2.2 pthread_setconcurrency F
 GLIBC_2.2 pthread_setspecific F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
index 3288c7dd84..424e2cf068 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
@@ -121,7 +121,6 @@  GLIBC_2.2 pthread_rwlockattr_getpshared F
 GLIBC_2.2 pthread_rwlockattr_init F
 GLIBC_2.2 pthread_rwlockattr_setkind_np F
 GLIBC_2.2 pthread_rwlockattr_setpshared F
-GLIBC_2.2 pthread_setcancelstate F
 GLIBC_2.2 pthread_setcanceltype F
 GLIBC_2.2 pthread_setconcurrency F
 GLIBC_2.2 pthread_setspecific F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
index 5fc406b7c1..5252f34efe 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
@@ -58,7 +58,6 @@  GLIBC_2.0 pthread_mutexattr_destroy F
 GLIBC_2.0 pthread_mutexattr_getkind_np F
 GLIBC_2.0 pthread_mutexattr_init F
 GLIBC_2.0 pthread_mutexattr_setkind_np F
-GLIBC_2.0 pthread_setcancelstate F
 GLIBC_2.0 pthread_setcanceltype F
 GLIBC_2.0 pthread_setspecific F
 GLIBC_2.0 pthread_testcancel F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
index f42e1d4f2f..2c131140ba 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
@@ -121,7 +121,6 @@  GLIBC_2.2 pthread_rwlockattr_getpshared F
 GLIBC_2.2 pthread_rwlockattr_init F
 GLIBC_2.2 pthread_rwlockattr_setkind_np F
 GLIBC_2.2 pthread_rwlockattr_setpshared F
-GLIBC_2.2 pthread_setcancelstate F
 GLIBC_2.2 pthread_setcanceltype F
 GLIBC_2.2 pthread_setconcurrency F
 GLIBC_2.2 pthread_setspecific F
diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c
index b53b81b8fc..501f8fbccd 100644
--- a/sysdeps/unix/sysv/linux/spawni.c
+++ b/sysdeps/unix/sysv/linux/spawni.c
@@ -354,8 +354,7 @@  __spawnix (pid_t * pid, const char *file,
 
   /* Disable asynchronous cancellation.  */
   int state;
-  __libc_ptf_call (__pthread_setcancelstate,
-                   (PTHREAD_CANCEL_DISABLE, &state), 0);
+  __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
 
   /* Child must set args.err to something non-negative - we rely on
      the parent and child sharing VM.  */
@@ -413,7 +412,7 @@  __spawnix (pid_t * pid, const char *file,
 
   __libc_signal_restore_set (&args.oldmask);
 
-  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
+  __pthread_setcancelstate (state, NULL);
 
   return ec;
 }
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
index 49fdd52a28..afa8bb1dd8 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
@@ -121,7 +121,6 @@  GLIBC_2.2.5 pthread_rwlockattr_getpshared F
 GLIBC_2.2.5 pthread_rwlockattr_init F
 GLIBC_2.2.5 pthread_rwlockattr_setkind_np F
 GLIBC_2.2.5 pthread_rwlockattr_setpshared F
-GLIBC_2.2.5 pthread_setcancelstate F
 GLIBC_2.2.5 pthread_setcanceltype F
 GLIBC_2.2.5 pthread_setconcurrency F
 GLIBC_2.2.5 pthread_setspecific F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
index 0384eaa51a..b8c545b9c0 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
@@ -133,7 +133,6 @@  GLIBC_2.16 pthread_rwlockattr_init F
 GLIBC_2.16 pthread_rwlockattr_setkind_np F
 GLIBC_2.16 pthread_rwlockattr_setpshared F
 GLIBC_2.16 pthread_setaffinity_np F
-GLIBC_2.16 pthread_setcancelstate F
 GLIBC_2.16 pthread_setcanceltype F
 GLIBC_2.16 pthread_setconcurrency F
 GLIBC_2.16 pthread_setname_np F