All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] safe_macros: Add SAFE_SIGFILLSET()
@ 2020-08-15  5:13 Xiao Yang
  2020-08-15  5:13 ` [LTP] [PATCH 2/2] syscalls/sigsuspend01.c: Convert to the new API Xiao Yang
  0 siblings, 1 reply; 4+ messages in thread
From: Xiao Yang @ 2020-08-15  5:13 UTC (permalink / raw)
  To: ltp

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 include/tst_safe_macros.h |  5 +++++
 lib/tst_safe_macros.c     | 10 ++++++++++
 2 files changed, 15 insertions(+)

diff --git a/include/tst_safe_macros.h b/include/tst_safe_macros.h
index 45fd0500a..000381c4f 100644
--- a/include/tst_safe_macros.h
+++ b/include/tst_safe_macros.h
@@ -446,6 +446,11 @@ void safe_sigemptyset(const char *file, const int lineno,
 #define SAFE_SIGEMPTYSET(sigs) \
 	safe_sigemptyset(__FILE__, __LINE__, (sigs))
 
+void safe_sigfillset(const char *file, const int lineno,
+		     sigset_t *sigs);
+#define SAFE_SIGFILLSET(sigs) \
+	safe_sigfillset(__FILE__, __LINE__, (sigs))
+
 void safe_sigprocmask(const char *file, const int lineno,
                       int how, sigset_t *set, sigset_t *oldset);
 #define SAFE_SIGPROCMASK(how, set, oldset) \
diff --git a/lib/tst_safe_macros.c b/lib/tst_safe_macros.c
index f18cb4625..25c37dfd8 100644
--- a/lib/tst_safe_macros.c
+++ b/lib/tst_safe_macros.c
@@ -166,6 +166,16 @@ void safe_sigemptyset(const char *file, const int lineno,
 		tst_brk_(file, lineno, TBROK | TERRNO, "sigemptyset() failed");
 }
 
+void safe_sigfillset(const char *file, const int lineno,
+		     sigset_t *sigs)
+{
+	int rval;
+
+	rval = sigfillset(sigs);
+	if (rval == -1)
+		tst_brk_(file, lineno, TBROK | TERRNO, "sigfillset() failed");
+}
+
 static const char *strhow(int how)
 {
 	switch (how) {
-- 
2.21.0




^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-17 15:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-15  5:13 [LTP] [PATCH 1/2] safe_macros: Add SAFE_SIGFILLSET() Xiao Yang
2020-08-15  5:13 ` [LTP] [PATCH 2/2] syscalls/sigsuspend01.c: Convert to the new API Xiao Yang
2020-08-17 14:33   ` Cyril Hrubis
2020-08-17 15:00     ` Xiao Yang

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.