summaryrefslogtreecommitdiff
path: root/test/sigreturn.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/sigreturn.c')
-rw-r--r--test/sigreturn.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/sigreturn.c b/test/sigreturn.c
new file mode 100644
index 0000000..246a3ce
--- /dev/null
+++ b/test/sigreturn.c
@@ -0,0 +1,30 @@
+/*
+ * Check that strace output contains RT_1 RT_3 RT_31 RT_32 here:
+ * rt_sigprocmask(SIG_BLOCK, [CHLD RT_1 RT_3 RT_31 RT_32], NULL, 8) = 0
+ * and here:
+ * sigreturn() (mask [CHLD RT_1 RT_3 RT_31 RT_32]) = 0
+ *
+ * On x86, both 32-bit and 64-bit strace needs to be checked.
+ */
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+
+void null_handler(int sig)
+{
+}
+
+int main(int argc, char *argv[])
+{
+ sigset_t set;
+ sigemptyset(&set);
+ sigaddset(&set, SIGCHLD);
+ sigaddset(&set, 33);
+ sigaddset(&set, 35);
+ sigaddset(&set, 63);
+ sigaddset(&set, 64);
+ sigprocmask(SIG_BLOCK, &set, NULL);
+ signal(SIGWINCH, null_handler);
+ raise(SIGWINCH);
+ return 0;
+}