]> granicus.if.org Git - strace/commitdiff
tests: add epoll_create.test
authorFei Jie <feij.fnst@cn.fujitsu.com>
Fri, 8 Apr 2016 07:59:14 +0000 (15:59 +0800)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 8 Apr 2016 07:59:14 +0000 (07:59 +0000)
* tests/epoll_create.c: New file.
* tests/epoll_create.test: New test.
* tests/.gitignore: Add epoll_create.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add epoll_create.test.

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

index ea67040b2d0285860554b26a8e590be95bf169a5..0478e1868cc9faab396fde5f1b58f041ce918193 100644 (file)
@@ -25,6 +25,7 @@ creat
 dup
 dup2
 dup3
+epoll_create
 epoll_create1
 eventfd
 execve
index 3d0b5d1f9f15d3156af8f0380ebbae216f5a856e..8dc667356e1c2fb9d57331dfaa1cc583feb5c334 100644 (file)
@@ -76,6 +76,7 @@ check_PROGRAMS = \
        dup \
        dup2 \
        dup3 \
+       epoll_create \
        epoll_create1 \
        eventfd \
        execve \
@@ -275,6 +276,7 @@ DECODER_TESTS = \
        dup.test \
        dup2.test \
        dup3.test \
+       epoll_create.test \
        epoll_create1.test \
        eventfd.test \
        execve.test \
diff --git a/tests/epoll_create.c b/tests/epoll_create.c
new file mode 100644 (file)
index 0000000..0b9e3a5
--- /dev/null
@@ -0,0 +1,25 @@
+#include "tests.h"
+#include <sys/syscall.h>
+
+#ifdef __NR_epoll_create
+
+# include <errno.h>
+# include <stdio.h>
+# include <unistd.h>
+
+int
+main(void)
+{
+       int rc = syscall(__NR_epoll_create, -1);
+       printf("epoll_create(-1) = %d %s (%m)\n",
+              rc, errno == ENOSYS ? "ENOSYS" : "EINVAL");
+
+       puts("+++ exited with 0 +++");
+       return 0;
+}
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_epoll_creat")
+
+#endif
diff --git a/tests/epoll_create.test b/tests/epoll_create.test
new file mode 100755 (executable)
index 0000000..472a9bd
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Check epoll_create syscall decoding.
+
+. "${srcdir=.}/init.sh"
+run_strace_match_diff -a17