summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/internal-signals.h
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-04-23 10:58:01 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-07-07 14:10:58 -0300
commitf26d456b98abf02b3ff92f1a3c0d4473b7ffd85c (patch)
treee61f7a38a3f7ce9b8394d1ce8001cf6a3a9dc33e /sysdeps/unix/sysv/linux/internal-signals.h
parentf13d260190d47bd38c0ae939080001e7bb58bd04 (diff)
downloadglibc-f26d456b98abf02b3ff92f1a3c0d4473b7ffd85c.tar.gz
linux: Fix __NSIG_WORDS and add __NSIG_BYTES
The __NSIG_WORDS value is based on minimum number of words to hold the maximum number of signals supported by the architecture. This patch also adds __NSIG_BYTES, which is the number of bytes required to represent the supported number of signals. It is used in syscalls which takes a sigset_t. Checked on x86_64-linux-gnu and i686-linux-gnu. Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux/internal-signals.h')
-rw-r--r--sysdeps/unix/sysv/linux/internal-signals.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/sysdeps/unix/sysv/linux/internal-signals.h b/sysdeps/unix/sysv/linux/internal-signals.h
index 3fbd4807d1..35f2de04c5 100644
--- a/sysdeps/unix/sysv/linux/internal-signals.h
+++ b/sysdeps/unix/sysv/linux/internal-signals.h
@@ -68,7 +68,7 @@ static inline void
__libc_signal_block_all (sigset_t *set)
{
INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_BLOCK, &sigall_set, set,
- _NSIG / 8);
+ __NSIG_BYTES);
}
/* Block all application signals (excluding internal glibc ones). */
@@ -78,7 +78,7 @@ __libc_signal_block_app (sigset_t *set)
sigset_t allset = sigall_set;
__clear_internal_signals (&allset);
INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_BLOCK, &allset, set,
- _NSIG / 8);
+ __NSIG_BYTES);
}
/* Block only SIGTIMER and return the previous set on SET. */
@@ -86,7 +86,7 @@ static inline void
__libc_signal_block_sigtimer (sigset_t *set)
{
INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_BLOCK, &sigtimer_set, set,
- _NSIG / 8);
+ __NSIG_BYTES);
}
/* Unblock only SIGTIMER and return the previous set on SET. */
@@ -94,7 +94,7 @@ static inline void
__libc_signal_unblock_sigtimer (sigset_t *set)
{
INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_UNBLOCK, &sigtimer_set, set,
- _NSIG / 8);
+ __NSIG_BYTES);
}
/* Restore current process signal mask. */
@@ -102,7 +102,7 @@ static inline void
__libc_signal_restore_set (const sigset_t *set)
{
INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_SETMASK, set, NULL,
- _NSIG / 8);
+ __NSIG_BYTES);
}
/* Used to communicate with signal handler. */