summaryrefslogtreecommitdiff
path: root/test/sigreturn.c
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2013-07-16 12:06:25 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2013-07-16 12:06:25 +0200
commitb51f364c4241aa247a7a22f92c06f1f1a4ab99b4 (patch)
tree31d0d194e5659cb0cfaaddcd2ca05c5a09a4f89f /test/sigreturn.c
parent9afc2ee682d2f9fd3ad938756c841d7f0eed5f21 (diff)
downloadstrace-b51f364c4241aa247a7a22f92c06f1f1a4ab99b4.tar.gz
strace-b51f364c4241aa247a7a22f92c06f1f1a4ab99b4.tar.bz2
strace-b51f364c4241aa247a7a22f92c06f1f1a4ab99b4.tar.xz
Improve sigreturn decoding on x86 to show RT signal bits too.
This includes decoding of 32-bit sigreturn by 64-bit strace, which previously wasn't done. Added a test for it. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
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;
+}