* [LTP] [PATCH] syscalls/rt_sigsuspend01: ignore reserved signals
@ 2018-11-17 4:51 Steve Muckle
2018-11-17 4:53 ` Steve Muckle
2018-11-19 13:36 ` Cyril Hrubis
0 siblings, 2 replies; 3+ messages in thread
From: Steve Muckle @ 2018-11-17 4:51 UTC (permalink / raw)
To: ltp
Some signals may be internally used by the C library. Do not attempt to
verify these.
Signed-off-by: Steve Muckle <smuckle@google.com>
---
.../kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
index 14b6bb332..f17a9aae6 100644
--- a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
+++ b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
@@ -26,6 +26,7 @@ static void sig_handler(int sig)
static void verify_rt_sigsuspend(void)
{
+ int i;
sigset_t set, set1, set2;
struct sigaction act = {.sa_handler = sig_handler};
@@ -51,11 +52,13 @@ static void verify_rt_sigsuspend(void)
tst_res(TPASS, "rt_sigsuspend() returned with -1 and EINTR");
SAFE_RT_SIGPROCMASK(0, NULL, &set2, SIGSETSIZE);
-
- if (memcmp(&set1, &set2, sizeof(unsigned long)))
- tst_res(TFAIL, "signal mask not preserved");
- else
- tst_res(TPASS, "signal mask preserved");
+ for (i = 1; i < SIGRTMAX; i++) {
+ if (i >= __SIGRTMIN && i < SIGRTMIN)
+ continue;
+ if (sigismember(&set1, i) != sigismember(&set2, i))
+ tst_brk(TFAIL, "signal mask not preserved");
+ }
+ tst_res(TPASS, "signal mask preserved");
}
static struct tst_test test = {
--
2.19.1.1215.g8438c0b245-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [LTP] [PATCH] syscalls/rt_sigsuspend01: ignore reserved signals
2018-11-17 4:51 [LTP] [PATCH] syscalls/rt_sigsuspend01: ignore reserved signals Steve Muckle
@ 2018-11-17 4:53 ` Steve Muckle
2018-11-19 13:36 ` Cyril Hrubis
1 sibling, 0 replies; 3+ messages in thread
From: Steve Muckle @ 2018-11-17 4:53 UTC (permalink / raw)
To: ltp
Hi Cyril this applies on top of the recent series you sent:
[LTP] [PATCH 0/3] Add rt signal newlib support + convert rt_sigsuspend01
thanks,
Steve
On 11/16/2018 08:51 PM, Steve Muckle wrote:
> Some signals may be internally used by the C library. Do not attempt to
> verify these.
>
> Signed-off-by: Steve Muckle <smuckle@google.com>
> ---
> .../kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
> index 14b6bb332..f17a9aae6 100644
> --- a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
> +++ b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
> @@ -26,6 +26,7 @@ static void sig_handler(int sig)
>
> static void verify_rt_sigsuspend(void)
> {
> + int i;
> sigset_t set, set1, set2;
> struct sigaction act = {.sa_handler = sig_handler};
>
> @@ -51,11 +52,13 @@ static void verify_rt_sigsuspend(void)
> tst_res(TPASS, "rt_sigsuspend() returned with -1 and EINTR");
>
> SAFE_RT_SIGPROCMASK(0, NULL, &set2, SIGSETSIZE);
> -
> - if (memcmp(&set1, &set2, sizeof(unsigned long)))
> - tst_res(TFAIL, "signal mask not preserved");
> - else
> - tst_res(TPASS, "signal mask preserved");
> + for (i = 1; i < SIGRTMAX; i++) {
> + if (i >= __SIGRTMIN && i < SIGRTMIN)
> + continue;
> + if (sigismember(&set1, i) != sigismember(&set2, i))
> + tst_brk(TFAIL, "signal mask not preserved");
> + }
> + tst_res(TPASS, "signal mask preserved");
> }
>
> static struct tst_test test = {
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [LTP] [PATCH] syscalls/rt_sigsuspend01: ignore reserved signals
2018-11-17 4:51 [LTP] [PATCH] syscalls/rt_sigsuspend01: ignore reserved signals Steve Muckle
2018-11-17 4:53 ` Steve Muckle
@ 2018-11-19 13:36 ` Cyril Hrubis
1 sibling, 0 replies; 3+ messages in thread
From: Cyril Hrubis @ 2018-11-19 13:36 UTC (permalink / raw)
To: ltp
Hi!
Pushed, thanks.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-19 13:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-17 4:51 [LTP] [PATCH] syscalls/rt_sigsuspend01: ignore reserved signals Steve Muckle
2018-11-17 4:53 ` Steve Muckle
2018-11-19 13:36 ` Cyril Hrubis
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.