]> granicus.if.org Git - strace/commitdiff
tests: check decoding of epoll_pwait syscall
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 9 May 2016 22:11:24 +0000 (22:11 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 9 May 2016 22:12:57 +0000 (22:12 +0000)
* tests/epoll_pwait.c: New file.
* tests/epoll_pwait.test: New test.
* tests/.gitignore: Add epoll_pwait.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add epoll_pwait.test.

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

index 102d8edd88216fdef6c2365340a9ea4fabf93002..1fa92390b013e12de7a43f79da5512370151c415 100644 (file)
@@ -32,6 +32,7 @@ dup3
 epoll_create
 epoll_create1
 epoll_ctl
+epoll_pwait
 epoll_wait
 eventfd
 execve
index c09701dcb2639ee428966ca73a7975259de95a54..a7b09592394847a62de3d50a5b5e2d556846568e 100644 (file)
@@ -87,6 +87,7 @@ check_PROGRAMS = \
        epoll_create \
        epoll_create1 \
        epoll_ctl \
+       epoll_pwait \
        epoll_wait \
        eventfd \
        execve \
@@ -369,6 +370,7 @@ DECODER_TESTS = \
        epoll_create.test \
        epoll_create1.test \
        epoll_ctl.test \
+       epoll_pwait.test \
        epoll_wait.test \
        eventfd.test \
        execve-v.test \
diff --git a/tests/epoll_pwait.c b/tests/epoll_pwait.c
new file mode 100644 (file)
index 0000000..a307e84
--- /dev/null
@@ -0,0 +1,29 @@
+#include "tests.h"
+#include <sys/syscall.h>
+
+#ifdef __NR_epoll_pwait
+
+# include <signal.h>
+# include <stdio.h>
+# include <sys/epoll.h>
+# include <unistd.h>
+
+int
+main(void)
+{
+       sigset_t set[2];
+       struct epoll_event *const ev = tail_alloc(sizeof(*ev));
+
+       long rc = syscall(__NR_epoll_pwait, -1, ev, 1, -2, set, sizeof(set));
+       printf("epoll_pwait(-1, %p, 1, -2, %p, %u) = %ld %s (%m)\n",
+              ev, set, (unsigned) sizeof(set), rc, errno2name());
+
+       puts("+++ exited with 0 +++");
+       return 0;
+}
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_epoll_pwait")
+
+#endif
diff --git a/tests/epoll_pwait.test b/tests/epoll_pwait.test
new file mode 100755 (executable)
index 0000000..c7aeeac
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Check decoding of epoll_pwait syscall.
+
+. "${srcdir=.}/init.sh"
+run_strace_match_diff