All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls: rt_sigwaitinfo01: Fix failure for MIPS arches
Date: Tue, 27 Aug 2019 15:26:19 -0400 (EDT)	[thread overview]
Message-ID: <4200333.8516580.1566933979370.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1566544121-147769-1-git-send-email-zhe.he@windriver.com>



----- Original Message -----
> From: He Zhe <zhe.he@windriver.com>
> 
> rt_sigtimedwait01 fails as follow on MIPS arches
> rt_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 adds specific case for MIPS.
> 
> Signed-off-by: He Zhe <zhe.he@windriver.com>
> ---
>  testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c
> b/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c
> index 5a32ce1..5c2fa99 100644
> --- a/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c
> +++ b/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c
> @@ -128,9 +128,16 @@ 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);
> +	/* The last argument is (number_of_signals)/(bits_per_byte), which are 64
> and 8, resp,
> +	 * except for MIPS which are 128 and 8, resp.
> +	 */
> +	return ltp_syscall(__NR_rt_sigtimedwait, set, info, timeout,
> +#ifdef __mips__
> +		16
> +#else
> +		8
> +#endif

Hi,

looking at kernel SYSCALL_DEFINE4(rt_sigtimedwait,..), the size is
used in this check:
        if (sigsetsize != sizeof(sigset_t))                                                                                                                   
                return -EINVAL; 

So I'm wondering if need to have an absolute value here, and if we can't
replace it with sizeof(sigset_t) or _NSIG / 8?

Regards,
Jan

  reply	other threads:[~2019-08-27 19:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23  7:08 [LTP] [PATCH] syscalls: rt_sigwaitinfo01: Fix failure for MIPS arches zhe.he
2019-08-27 19:26 ` Jan Stancek [this message]
2019-08-28 12:23   ` Cyril Hrubis
2019-08-29 13:08   ` He Zhe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4200333.8516580.1566933979370.JavaMail.zimbra@redhat.com \
    --to=jstancek@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.