about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/ppoll.c
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/ppoll.c
parentf13d260190d47bd38c0ae939080001e7bb58bd04 (diff)
downloadglibc-f26d456b98abf02b3ff92f1a3c0d4473b7ffd85c.tar.gz
glibc-f26d456b98abf02b3ff92f1a3c0d4473b7ffd85c.tar.xz
glibc-f26d456b98abf02b3ff92f1a3c0d4473b7ffd85c.zip
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/ppoll.c')
-rw-r--r--sysdeps/unix/sysv/linux/ppoll.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/ppoll.c b/sysdeps/unix/sysv/linux/ppoll.c
index 4ffb23710e..0f15636cce 100644
--- a/sysdeps/unix/sysv/linux/ppoll.c
+++ b/sysdeps/unix/sysv/linux/ppoll.c
@@ -41,11 +41,12 @@ __ppoll64 (struct pollfd *fds, nfds_t nfds, const struct __timespec64 *timeout,
 # ifndef __NR_ppoll_time64
 #  define __NR_ppoll_time64 __NR_ppoll
 # endif
-  return SYSCALL_CANCEL (ppoll_time64, fds, nfds, timeout, sigmask, _NSIG / 8);
+  return SYSCALL_CANCEL (ppoll_time64, fds, nfds, timeout, sigmask,
+			 __NSIG_BYTES);
 #else
 # ifdef __NR_ppoll_time64
   int ret = SYSCALL_CANCEL (ppoll_time64, fds, nfds, timeout, sigmask,
-                            _NSIG / 8);
+                            __NSIG_BYTES);
   if (ret >= 0 || errno != ENOSYS)
     return ret;
 # endif
@@ -62,7 +63,7 @@ __ppoll64 (struct pollfd *fds, nfds_t nfds, const struct __timespec64 *timeout,
     }
 
   return SYSCALL_CANCEL (ppoll, fds, nfds, timeout ? &ts32 : NULL, sigmask,
-                         _NSIG / 8);
+                         __NSIG_BYTES);
 #endif
 }