]> granicus.if.org Git - strace/commitdiff
tests: add rt_sigqueueinfo.test
authorElvira Khabirova <lineprinter0@gmail.com>
Fri, 21 Aug 2015 15:49:14 +0000 (18:49 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 28 Aug 2015 08:46:23 +0000 (08:46 +0000)
* tests/rt_sigqueueinfo.c: New file.
* tests/rt_sigqueueinfo.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add rt_sigqueueinfo.
(TESTS): Add rt_sigqueueinfo.test.
* tests/.gitignore: Add rt_sigqueueinfo.

tests/.gitignore
tests/Makefile.am
tests/rt_sigqueueinfo.c [new file with mode: 0644]
tests/rt_sigqueueinfo.test [new file with mode: 0755]

index 4e609c0c75ff007abe5aae0a435701dccf7be292..ef0d5738c49a5784d43f953691c59aabf8239328 100644 (file)
@@ -27,6 +27,7 @@ pipe
 ppoll
 readlink
 readlinkat
+rt_sigqueueinfo
 sched_xetattr
 scm_rights
 seccomp
index 1b078e010b9d3314f51db5e6a0f7bd5375f0a221..316cc409390fb9b956ba5b6df7008a8ad8c3637e 100644 (file)
@@ -40,6 +40,7 @@ check_PROGRAMS = \
        ppoll \
        readlink \
        readlinkat \
+       rt_sigqueueinfo \
        sched_xetattr \
        scm_rights \
        seccomp \
@@ -101,6 +102,7 @@ TESTS = \
        ipc_sem.test \
        readlink.test \
        readlinkat.test \
+       rt_sigqueueinfo.test \
        sched_xetattr.test \
        scm_rights-fd.test \
        seccomp.test \
diff --git a/tests/rt_sigqueueinfo.c b/tests/rt_sigqueueinfo.c
new file mode 100644 (file)
index 0000000..ab00da8
--- /dev/null
@@ -0,0 +1,27 @@
+#include <stdio.h>
+#include <signal.h>
+#include <unistd.h>
+
+int
+main (void)
+{
+       struct sigaction sa = {
+               .sa_handler = SIG_IGN
+       };
+       union sigval value = {
+               .sival_ptr = (void *) (unsigned long) 0xdeadbeefbadc0ded
+       };
+       pid_t pid = getpid();
+
+       if (sigaction(SIGUSR1, &sa, NULL) == -1)
+               return 77;
+       if (sigqueue(pid, SIGUSR1, value) == -1)
+               return 77;
+       printf("rt_sigqueueinfo(%u, SIGUSR1, {si_signo=SIGUSR1, "
+               "si_code=SI_QUEUE, si_pid=%u, si_uid=%u, "
+               "si_value={int=%d, ptr=%p}}) = 0\n",
+               pid, pid, getuid(), value.sival_int, value.sival_ptr);
+       printf("+++ exited with 0 +++\n");
+
+       return 0;
+}
diff --git a/tests/rt_sigqueueinfo.test b/tests/rt_sigqueueinfo.test
new file mode 100755 (executable)
index 0000000..bf76681
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Check decoding of rt_sigqueueinfo syscall
+
+. "${srcdir=.}/init.sh"
+
+run_prog > /dev/null
+OUT="$LOG.out"
+run_strace -ert_sigqueueinfo -esignal=none $args > "$OUT"
+match_diff "$OUT" "$LOG"
+rm -f "$OUT"
+
+exit 0