[PATCH v2 3/4] linux: Use pthread_sigmask on sigprocmask

Florian Weimer fw@deneb.enyo.de
Tue Apr 21 12:01:08 GMT 2020


* Adhemerval Zanella via Libc-alpha:

> With pthread_sigmask on libc.so, it allows consolidate both
> implementations.

“in sigprocmask”?

> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
> index edec8d0501..c6d8fc69be 100644
> --- a/nptl/pthreadP.h
> +++ b/nptl/pthreadP.h
> @@ -484,6 +484,7 @@ extern int __pthread_clockjoin_ex (pthread_t, void **, clockid_t,
>    attribute_hidden;
>  extern int __pthread_sigmask (int how, const sigset_t *newmask,
>  			      sigset_t *oldmask);
> +libc_hidden_proto (__pthread_sigmask)
>  
>  
>  #if IS_IN (libpthread)
> diff --git a/nptl/pthread_sigmask.c b/nptl/pthread_sigmask.c
> index 0e326d610c..c6c6e83c08 100644
> --- a/nptl/pthread_sigmask.c
> +++ b/nptl/pthread_sigmask.c
> @@ -46,6 +46,8 @@ __pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask)
>  	  ? INTERNAL_SYSCALL_ERRNO (result)
>  	  : 0);
>  }
> +libc_hidden_def (__pthread_sigmask)
> +
>  versioned_symbol (libc, __pthread_sigmask, pthread_sigmask, GLIBC_2_32);
>  #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32)
>  strong_alias (__pthread_sigmask, __pthread_sigmask_2);

Ah, perhaps put this into the first commit?

> diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c
> index eb9e4d5e83..6ed0ab1e6a 100644
> --- a/sysdeps/unix/sysv/linux/sigprocmask.c
> +++ b/sysdeps/unix/sysv/linux/sigprocmask.c

> +  int result = __pthread_sigmask (how, set, oset);
> +  if (result == 0)
> +    return 0;
> +  __set_errno (result);
> +  return result;

The final statement needs to return -1.  It's curious that this does
not result in a testsuite failure.


More information about the Libc-alpha mailing list