epoll_create1: fix flags decoding
* xlat/epollflags.in: Remove EPOLL_NONBLOCK, provide fallback definition
for EPOLL_CLOEXEC.
* tests/epoll_create1.c: New file.
* tests/epoll_create1.expected: Likewise.
* tests/epoll_create1.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add epoll_create1.
(TESTS): Add epoll_create1.test.
(EXTRA_DIST): Add epoll_create1.expected.
* tests/.gitignore: Add epoll_create1.
diff --git a/tests/.gitignore b/tests/.gitignore
index 9b73a95..ee71e78 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -1,5 +1,6 @@
bpf
caps
+epoll_create1
eventfd
execve
execveat
diff --git a/tests/Makefile.am b/tests/Makefile.am
index dc76ddd..180f473 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -11,6 +11,7 @@
check_PROGRAMS = \
bpf \
caps \
+ epoll_create1 \
eventfd \
execve \
execveat \
@@ -72,6 +73,7 @@
bpf.test \
caps.test \
dumpio.test \
+ epoll_create1.test \
eventfd.test \
execve.test \
execveat.test \
@@ -131,6 +133,7 @@
EXTRA_DIST = init.sh run.sh match.awk \
caps.awk \
dumpio.expected \
+ epoll_create1.expected \
eventfd.expected \
execve.expected \
execve-v.expected \
diff --git a/tests/epoll_create1.c b/tests/epoll_create1.c
new file mode 100644
index 0000000..a165d65
--- /dev/null
+++ b/tests/epoll_create1.c
@@ -0,0 +1,20 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+int
+main(void)
+{
+#ifdef __NR_epoll_create1
+ (void) close(0);
+ if (syscall(__NR_epoll_create1, O_CLOEXEC))
+ return 77;
+ return syscall(__NR_epoll_create1, O_CLOEXEC | O_NONBLOCK) >= 0;
+#else
+ return 77;
+#endif
+}
diff --git a/tests/epoll_create1.expected b/tests/epoll_create1.expected
new file mode 100644
index 0000000..0e82f61
--- /dev/null
+++ b/tests/epoll_create1.expected
@@ -0,0 +1,2 @@
+epoll_create1\(EPOLL_CLOEXEC\) += 0
+epoll_create1\(EPOLL_CLOEXEC\|0x[[:xdigit:]]+\) += -1 EINVAL .*
diff --git a/tests/epoll_create1.test b/tests/epoll_create1.test
new file mode 100755
index 0000000..fa93a2b
--- /dev/null
+++ b/tests/epoll_create1.test
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# Check epoll_create1 syscall decoding.
+
+. "${srcdir=.}/init.sh"
+
+run_prog
+run_strace -e epoll_create1 $args
+match_grep
+
+exit 0