From f26d456b98abf02b3ff92f1a3c0d4473b7ffd85c Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 23 Apr 2020 10:58:01 -0300 Subject: 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 Reviewed-by: Carlos O'Donell --- nptl/nptl-init.c | 2 +- nptl/pthread_sigmask.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'nptl') diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c index d4cf20e..95c60a5 100644 --- a/nptl/nptl-init.c +++ b/nptl/nptl-init.c @@ -281,7 +281,7 @@ __pthread_initialize_minimal_internal (void) __sigaddset (&sa.sa_mask, SIGCANCEL); __sigaddset (&sa.sa_mask, SIGSETXID); INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_UNBLOCK, &sa.sa_mask, - NULL, _NSIG / 8); + NULL, __NSIG_BYTES); /* Get the size of the static and alignment requirements for the TLS block. */ diff --git a/nptl/pthread_sigmask.c b/nptl/pthread_sigmask.c index d266d29..7b65ae1 100644 --- a/nptl/pthread_sigmask.c +++ b/nptl/pthread_sigmask.c @@ -39,7 +39,7 @@ __pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask) /* We know that realtime signals are available if NPTL is used. */ int result = INTERNAL_SYSCALL_CALL (rt_sigprocmask, how, newmask, - oldmask, _NSIG / 8); + oldmask, __NSIG_BYTES); return (INTERNAL_SYSCALL_ERROR_P (result) ? INTERNAL_SYSCALL_ERRNO (result) -- cgit v1.1