1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

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>
This commit is contained in:
Adhemerval Zanella
2020-04-23 10:58:01 -03:00
parent f13d260190
commit f26d456b98
15 changed files with 42 additions and 27 deletions

View File

@ -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
}