diff options
Diffstat (limited to 'sysdeps')
37 files changed, 249 insertions, 90 deletions
diff --git a/sysdeps/generic/internal-signals.h b/sysdeps/generic/internal-signals.h index 01e5b75b6b..1bae0fd875 100644 --- a/sysdeps/generic/internal-signals.h +++ b/sysdeps/generic/internal-signals.h @@ -1,4 +1,4 @@ -/* Special use of signals internally. Stub version. +/* Special use of signals internally. Generic version. Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -15,3 +15,52 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ + +#ifndef __INTERNAL_SIGNALS_H +# define __INTERNAL_SIGNALS_H + +#include <signal.h> +#include <sigsetops.h> + +/* Return whether sig is used internally. */ +static inline int +__is_internal_signal (int sig) +{ + return 0; +} + +/* Remove internal glibc signals from the mask. */ +static inline void +__clear_internal_signals (sigset_t *set) +{ +} + +/* Block all signals, including internal glibc ones; write the previous + signal mask to SET. */ +static inline int +__libc_signal_block_all (sigset_t *set) +{ + sigset_t allset; + __sigfillset (&allset); + return __sigprocmask (SIG_BLOCK, &allset, set); +} + +/* Block all application signals (excluding internal glibc ones); write + the previous signal mask to SET. */ +static inline int +__libc_signal_block_app (sigset_t *set) +{ + sigset_t allset; + __sigfillset (&allset); + __clear_internal_signals (&allset); + return __sigprocmask (SIG_BLOCK, &allset, set); +} + +/* Restore process signal mask according to SET. */ +static inline int +__libc_signal_restore_set (const sigset_t *set) +{ + return __sigprocmask (SIG_SETMASK, set, NULL); +} + +#endif diff --git a/sysdeps/generic/pt-compat-stubs.S b/sysdeps/generic/pt-compat-stubs.S index 426689a18d..d9d49f6b16 100644 --- a/sysdeps/generic/pt-compat-stubs.S +++ b/sysdeps/generic/pt-compat-stubs.S @@ -131,6 +131,9 @@ define_stub(pause) compat_stub(pause, pause, GLIBC_2_0) + define_stub(raise) + compat_stub(raise, raise, GLIBC_2_0) + define_stub(read) compat_stub(read, read, GLIBC_2_0) compat_stub(read, __read, GLIBC_2_0) @@ -171,6 +174,9 @@ compat_stub(write, write, GLIBC_2_0) compat_stub(write, __write, GLIBC_2_0) + define_stub(pthread_kill) + compat_stub(pthread_kill, pthread_kill, GLIBC_2_0) + #endif /* The off64_t functions were added in glibc 2.2, but some architectures diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 9545e898c1..daf8c16aae 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -2049,6 +2049,8 @@ GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/posix/raise.c b/sysdeps/posix/raise.c index 1f02b201e1..f171dc2407 100644 --- a/sysdeps/posix/raise.c +++ b/sysdeps/posix/raise.c @@ -15,14 +15,55 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +#include <errno.h> #include <signal.h> #include <unistd.h> +#include <internal-signals.h> -/* Raise the signal SIG. */ +/* Raise the signal SIG. POSIX requires raise to be async-signal-safe, + but calling getpid and then raise is *not* async-signal-safe; if an + async signal handler calls fork (which is also async-signal-safe) + in between the two operations, and returns normally on both sides + of the fork, kill will be called twice. So we must block signals + around the operation. See bug 15368 for more detail. + */ int -raise (int sig) +__libc_raise (int sig) { - return __kill (__getpid (), sig); + /* Disallow sending the signals we use for cancellation, timers, + setxid, etc. This check is also performed in __kill, but + if we do it now we can avoid blocking and then unblocking signals + unnecessarily. */ + if (__glibc_unlikely (__is_internal_signal (sig))) + { + __set_errno (EINVAL); + return -1; + } + + /* We can safely assume that __libc_signal_block_app and + __libc_signal_restore_set will not fail, because + sigprocmask can only fail under three circumstances: + + 1. sigsetsize != sizeof (sigset_t) (EINVAL) + 2. a failure in copy from/to user space (EFAULT) + 3. an invalid 'how' operation (EINVAL) + + Getting any of these would indicate a bug in either the + definition of sigset_t or the implementations of the + wrappers. */ + sigset_t omask; + __libc_signal_block_app (&omask); + + int ret = __kill (__getpid (), sig); + + /* ... But just because sigprocmask will not fail here, that doesn't + mean it won't clobber errno. */ + int save_errno = errno; + __libc_signal_restore_set (&omask); + __set_errno (errno); + + return ret; } +strong_alias (__libc_raise, raise) libc_hidden_def (raise) weak_alias (raise, gsignal) diff --git a/sysdeps/pthread/raise.c b/sysdeps/pthread/raise.c new file mode 100644 index 0000000000..583cd1535d --- /dev/null +++ b/sysdeps/pthread/raise.c @@ -0,0 +1,76 @@ +/* ISO C raise function for libpthread. + Copyright (C) 2002-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <pthread.h> +#include <signal.h> +#include <internal-signals.h> + +/* Raise the signal SIG. POSIX requires raise to be async-signal-safe, + but also requires it to be equivalent to pthread_kill (pthread_self (), sig), + and that construct is *not* async-signal safe. In particular, an + async signal handler that calls fork (which is also async-signal-safe) + could invalidate the handle returned by pthread_self, and/or cause + pthread_kill to be called twice. So we must block signals around + the operation. See bug 15368 for more detail. + + Also, raise sets errno on failure, whereas pthread_kill returns the + error code. (It is not possible for pthread_self to fail.) */ + +int +__libc_raise (int sig) +{ + /* Disallow sending the signals we use for cancellation, timers, + setxid, etc. This check is also performed in pthread_kill, but + if we do it now we can avoid blocking and then unblocking signals + unnecessarily. */ + if (__glibc_unlikely (__is_internal_signal (sig))) + { + __set_errno (EINVAL); + return -1; + } + + /* We can safely assume that __libc_signal_block_app and + __libc_signal_restore_set will not fail, because + sigprocmask can only fail under three circumstances: + + 1. sigsetsize != sizeof (sigset_t) (EINVAL) + 2. a failure in copy from/to user space (EFAULT) + 3. an invalid 'how' operation (EINVAL) + + Getting any of these would indicate a bug in either the + definition of sigset_t or the implementations of the + wrappers. */ + sigset_t omask; + __libc_signal_block_app (&omask); + + int ret = __pthread_kill (__pthread_self (), sig); + + __libc_signal_restore_set (&omask); + + if (__glibc_unlikely (ret)) + { + __set_errno (ret); + return -1; + } + return 0; +} +strong_alias (__libc_raise, raise) +libc_hidden_def (raise) +weak_alias (__libc_raise, gsignal) diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index 90c9bc84e1..8c0cf4d7af 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2139,3 +2139,5 @@ GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index 8674a874b4..df3e7d6628 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -2054,6 +2054,8 @@ GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/arm/libc.abilist b/sysdeps/unix/sysv/linux/arm/libc.abilist index 044ec102c2..52ab98b3de 100644 --- a/sysdeps/unix/sysv/linux/arm/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/libc.abilist @@ -130,6 +130,8 @@ GLIBC_2.27 wcstof32x F GLIBC_2.27 wcstof32x_l F GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0xa0 diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 2360130abe..e2f2a991fe 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -1894,6 +1894,8 @@ GLIBC_2.27 wcstof32x F GLIBC_2.27 wcstof32x_l F GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index 39c993fd79..bacf5a184d 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2064,6 +2064,8 @@ GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index 68496aa6ac..236f087894 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -1928,6 +1928,8 @@ GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/internal-signals.h b/sysdeps/unix/sysv/linux/internal-signals.h index e007372f21..ad828ff56a 100644 --- a/sysdeps/unix/sysv/linux/internal-signals.h +++ b/sysdeps/unix/sysv/linux/internal-signals.h @@ -36,14 +36,14 @@ #define SIGSETXID (__SIGRTMIN + 1) -/* Return is sig is used internally. */ +/* Return whether sig is used internally. */ static inline int __is_internal_signal (int sig) { return (sig == SIGCANCEL) || (sig == SIGSETXID); } -/* Remove internal glibc signal from the mask. */ +/* Remove internal glibc signals from the mask. */ static inline void __clear_internal_signals (sigset_t *set) { @@ -54,7 +54,8 @@ __clear_internal_signals (sigset_t *set) #define SIGALL_SET \ ((__sigset_t) { .__val = {[0 ... _SIGSET_NWORDS-1 ] = -1 } }) -/* Block all signals, including internal glibc ones. */ +/* Block all signals, including internal glibc ones; write the previous + signal mask to SET. */ static inline int __libc_signal_block_all (sigset_t *set) { @@ -63,7 +64,8 @@ __libc_signal_block_all (sigset_t *set) set, _NSIG / 8); } -/* Block all application signals (excluding internal glibc ones). */ +/* Block all application signals (excluding internal glibc ones); write + the previous signal mask to SET. */ static inline int __libc_signal_block_app (sigset_t *set) { @@ -74,7 +76,7 @@ __libc_signal_block_app (sigset_t *set) _NSIG / 8); } -/* Restore current process signal mask. */ +/* Restore process signal mask according to SET. */ static inline int __libc_signal_restore_set (const sigset_t *set) { diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index b676025261..206341cd8d 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -131,6 +131,8 @@ GLIBC_2.27 wcstof32x F GLIBC_2.27 wcstof32x_l F GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0x98 diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index cdd1df55d0..9d476461c8 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2008,6 +2008,8 @@ GLIBC_2.27 wcstof32x F GLIBC_2.27 wcstof32x_l F GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/microblaze/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/libc.abilist index e4265fd74d..6bb0c62b62 100644 --- a/sysdeps/unix/sysv/linux/microblaze/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/libc.abilist @@ -2129,3 +2129,5 @@ GLIBC_2.27 wcstof32x F GLIBC_2.27 wcstof32x_l F GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 3a7e0b4c29..840093d0ac 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -1983,6 +1983,8 @@ GLIBC_2.27 wcstof32x F GLIBC_2.27 wcstof32x_l F GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index 5e805924fa..cccc333aeb 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -1981,6 +1981,8 @@ GLIBC_2.27 wcstof32x F GLIBC_2.27 wcstof32x_l F GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index 1973fac36d..4128e9f72a 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -1989,6 +1989,8 @@ GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index 5e18ab83b4..601b038ede 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -1984,6 +1984,8 @@ GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index cc5885ab9b..4edb4667a8 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2170,3 +2170,5 @@ GLIBC_2.27 wcstof32x F GLIBC_2.27 wcstof32x_l F GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 676aa50c81..0c6f194b74 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2012,6 +2012,8 @@ GLIBC_2.27 wcstof32x F GLIBC_2.27 wcstof32x_l F GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index 2016c7c1e5..9a9be2258a 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2017,6 +2017,8 @@ GLIBC_2.27 wcstof32x F GLIBC_2.27 wcstof32x_l F GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist index 3d19e38dbd..f4b710075e 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist @@ -2229,3 +2229,5 @@ GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist index c57ab21b82..658dd0f0df 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist @@ -131,6 +131,8 @@ GLIBC_2.27 wcstof32x F GLIBC_2.27 wcstof32x_l F GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 _Exit F GLIBC_2.3 _IO_2_1_stderr_ D 0xe0 diff --git a/sysdeps/unix/sysv/linux/pt-raise.c b/sysdeps/unix/sysv/linux/pt-raise.c deleted file mode 100644 index b5513d4537..0000000000 --- a/sysdeps/unix/sysv/linux/pt-raise.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ISO C raise function for libpthread. - Copyright (C) 2002-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdeps/unix/sysv/linux/raise.c> diff --git a/sysdeps/unix/sysv/linux/pthread_kill.c b/sysdeps/unix/sysv/linux/pthread_kill.c index 3a6171b815..80939cdd92 100644 --- a/sysdeps/unix/sysv/linux/pthread_kill.c +++ b/sysdeps/unix/sysv/linux/pthread_kill.c @@ -22,10 +22,10 @@ #include <tls.h> #include <sysdep.h> #include <unistd.h> - +#include <internal-signals.h> int -__pthread_kill (pthread_t threadid, int signo) +__libc_pthread_kill (pthread_t threadid, int signo) { struct pthread *pd = (struct pthread *) threadid; @@ -42,18 +42,18 @@ __pthread_kill (pthread_t threadid, int signo) /* Not a valid thread handle. */ return ESRCH; - /* Disallow sending the signal we use for cancellation, timers, - for the setxid implementation. */ - if (signo == SIGCANCEL || signo == SIGTIMER || signo == SIGSETXID) + /* Disallow sending the signals we use for cancellation, timers, + setxid, etc. */ + if (__is_internal_signal (signo)) return EINVAL; /* We have a special syscall to do the work. */ INTERNAL_SYSCALL_DECL (err); - pid_t pid = __getpid (); - + pid_t pid = INTERNAL_SYSCALL_CALL (getpid, err); int val = INTERNAL_SYSCALL_CALL (tgkill, err, pid, tid, signo); return (INTERNAL_SYSCALL_ERROR_P (val, err) ? INTERNAL_SYSCALL_ERRNO (val, err) : 0); } -strong_alias (__pthread_kill, pthread_kill) +strong_alias (__libc_pthread_kill, __pthread_kill) +weak_alias (__libc_pthread_kill, pthread_kill) diff --git a/sysdeps/unix/sysv/linux/raise.c b/sysdeps/unix/sysv/linux/raise.c deleted file mode 100644 index b05eae202f..0000000000 --- a/sysdeps/unix/sysv/linux/raise.c +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (C) 2002-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <signal.h> -#include <sysdep.h> -#include <errno.h> -#include <sys/types.h> -#include <unistd.h> -#include <internal-signals.h> - -int -raise (int sig) -{ - /* rt_sigprocmask may fail if: - - 1. sigsetsize != sizeof (sigset_t) (EINVAL) - 2. a failure in copy from/to user space (EFAULT) - 3. an invalid 'how' operation (EINVAL) - - The first case is already handle in glibc syscall call by using the arch - defined _NSIG. Second case is handled by using a stack allocated mask. - The last one should be handled by the block/unblock functions. */ - - sigset_t set; - __libc_signal_block_app (&set); - - INTERNAL_SYSCALL_DECL (err); - pid_t pid = INTERNAL_SYSCALL (getpid, err, 0); - pid_t tid = INTERNAL_SYSCALL (gettid, err, 0); - - int ret = INLINE_SYSCALL (tgkill, 3, pid, tid, sig); - - __libc_signal_restore_set (&set); - - return ret; -} -libc_hidden_def (raise) -weak_alias (raise, gsignal) diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist index 8ab44ec41f..60342db2a9 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist @@ -2094,3 +2094,5 @@ GLIBC_2.27 xdrstdio_create F GLIBC_2.27 xencrypt F GLIBC_2.27 xprt_register F GLIBC_2.27 xprt_unregister F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 25903720e3..4f5d0bb82f 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2022,6 +2022,8 @@ GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index 5d6800c236..1810c6e152 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -1923,6 +1923,8 @@ GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/sh/libc.abilist b/sysdeps/unix/sysv/linux/sh/libc.abilist index c04872ca7f..0d1a7d095f 100644 --- a/sysdeps/unix/sysv/linux/sh/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/libc.abilist @@ -1898,6 +1898,8 @@ GLIBC_2.27 wcstof32x F GLIBC_2.27 wcstof32x_l F GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 85cbe308d6..182f7d6e2c 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2015,6 +2015,8 @@ GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index f7a1ab8edb..1ed8c8a5ae 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -1952,6 +1952,8 @@ GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/tile/tilegx32/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilegx32/libc.abilist index ab56ecee44..e1cea90f30 100644 --- a/sysdeps/unix/sysv/linux/tile/tilegx32/libc.abilist +++ b/sysdeps/unix/sysv/linux/tile/tilegx32/libc.abilist @@ -2136,3 +2136,5 @@ GLIBC_2.27 wcstof32x F GLIBC_2.27 wcstof32x_l F GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F diff --git a/sysdeps/unix/sysv/linux/tile/tilegx64/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilegx64/libc.abilist index f2518c08ff..78bdfa766b 100644 --- a/sysdeps/unix/sysv/linux/tile/tilegx64/libc.abilist +++ b/sysdeps/unix/sysv/linux/tile/tilegx64/libc.abilist @@ -2136,3 +2136,5 @@ GLIBC_2.27 wcstof32x F GLIBC_2.27 wcstof32x_l F GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index 2a3cc40674..89f19bbc9d 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -1905,6 +1905,8 @@ GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index 8bc16b9004..727a8b4151 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2148,3 +2148,5 @@ GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F +GLIBC_2.28 GLIBC_2.28 A +GLIBC_2.28 pthread_kill F |