* tests/fdatasync.c: New file.
* tests/fdatasync.test: New test.
* tests/.gitignore: Add fdatasync.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fdatasync.test.
---
 tests/.gitignore     |  1 +
 tests/Makefile.am    |  2 ++
 tests/fdatasync.c    | 27 +++++++++++++++++++++++++++
 tests/fdatasync.test |  6 ++++++
 4 files changed, 36 insertions(+)
 create mode 100644 tests/fdatasync.c
 create mode 100755 tests/fdatasync.test

diff --git a/tests/.gitignore b/tests/.gitignore
index 68236a8..9ab1aae 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -35,6 +35,7 @@ fanotify_mark
 fchmod
 fcntl
 fcntl64
+fdatasync
 file_handle
 filter-unavailable
 flock
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4d18fe6..da97271 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -86,6 +86,7 @@ check_PROGRAMS = \
        fchmod \
        fcntl \
        fcntl64 \
+       fdatasync \
        file_handle \
        filter-unavailable \
        flock \
@@ -272,6 +273,7 @@ DECODER_TESTS = \
        fchmod.test \
        fcntl.test \
        fcntl64.test \
+       fdatasync.test \
        file_handle.test \
        flock.test \
        fstat.test \
diff --git a/tests/fdatasync.c b/tests/fdatasync.c
new file mode 100644
index 0000000..382f47d
--- /dev/null
+++ b/tests/fdatasync.c
@@ -0,0 +1,27 @@
+#include "tests.h"
+#include <sys/syscall.h>
+
+#ifdef __NR_fdatasync
+
+# include <errno.h>
+# include <stdio.h>
+# include <unistd.h>
+
+int
+main(void)
+{
+       const long int fd = (long int) 0xdeadbeefffffffff;
+       int rc = syscall(__NR_fdatasync, fd);
+       printf("fdatasync(%d) = %d %s (%m)\n",
+              (int) fd, rc,
+              errno == ENOSYS ? "ENOSYS" : "EBADF");
+
+       puts("+++ exited with 0 +++");
+       return 0;
+}
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_fdatasync")
+
+#endif
diff --git a/tests/fdatasync.test b/tests/fdatasync.test
new file mode 100755
index 0000000..ff59749
--- /dev/null
+++ b/tests/fdatasync.test
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Check fdatasync syscall decoding.
+
+. "${srcdir=.}/init.sh"
+run_strace_match_diff -a14
-- 
1.8.3.1




------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to