syscall: rt_sigtimedwait01: Fix wrong sigset length for mips
PATCH v2 1/1 syscall: rt_sigtimedwait01: Fix wrong sigset length for mips
From: He Zhe <[email protected]>
rt_sigtimedwait01 fails as follow on MIPS archesrt_sigtimedwait01 1 TFAIL : .../sigwaitinfo01.c:58: test_empty_set
(.../sigwaitinfo01.c: 148): Unexpected failure:
TEST_ERRNO=EINVAL(22): Invalid argument
As this case purposely bypasses glibc, it should align with the size of kernel definition of sigset_t which is different from other arches.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/mips/include/uapi/asm/signal.h#n15
This patch turns to use _NSIG which is always right for all arches.
---
v2: Use _NSIG/8 instead of fixed numbers
testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c +2 -3
@@ -128,9 +128,8 @@ static int my_sigtimedwait(const sigset_t * set, siginfo_t * info,static int my_rt_sigtimedwait (const sigset_t * set,siginfo_t * info,struct timespec *timeout) { - -/* The last argument is (number_of_signals)/(bits_per_byte), which are 64 and 8, resp. */ -return ltp_syscall (__NR_rt_sigtimedwait, set, info, timeout,8 ); +/* _NSIG is always the right number of bits of signal map for all arches */ +return ltp_syscall (__NR_rt_sigtimedwait, set, info, timeout, _NSIG/8 ); }#endif
Signature · 1 line
2.7.4
PATCH v2 1/1 syscall: rt_sigtimedwait01: Fix wrong sigset length for mips
Hi He,
Quoted 11 lines
From: He Zhe <[email protected]>
rt_sigtimedwait01fails as follow on MIPS archesrt_sigtimedwait011 TFAIL :.../sigwaitinfo01.c:58:test_empty_set
(.../sigwaitinfo01.c: 148): Unexpected failure:
TEST_ERRNO=EINVAL(22): Invalid argumentAs this case purposely bypasses glibc, it should align with the size of kernel definition of
sigset_twhich is different from other arches.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/mips/include/uapi/asm/signal.h#n15
Quoted 5 lines
This patch turns to use
_NSIGwhich is always right for all arches.Signed-off-by He Zhe <[email protected]>---
v2: Use _NSIG/8 instead of fixed numbers
Thanks, merged.
Kind regards,
Petr