From: Steve Muckle <smuckle@google.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/rt_sigsuspend01: ignore reserved signals
Date: Fri, 16 Nov 2018 20:51:59 -0800 [thread overview]
Message-ID: <20181117045159.215245-1-smuckle@google.com> (raw)
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
next reply other threads:[~2018-11-17 4:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-17 4:51 Steve Muckle [this message]
2018-11-17 4:53 ` [LTP] [PATCH] syscalls/rt_sigsuspend01: ignore reserved signals Steve Muckle
2018-11-19 13:36 ` Cyril Hrubis
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=20181117045159.215245-1-smuckle@google.com \
--to=smuckle@google.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.