diff options
Diffstat (limited to 'sysdeps/generic')
-rw-r--r-- | sysdeps/generic/internal-signals.h | 51 | ||||
-rw-r--r-- | sysdeps/generic/pt-compat-stubs.S | 6 |
2 files changed, 56 insertions, 1 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 |