* tests/fchdir.c: New file.
* tests/fchdir.test: New test.
* tests/.gitignore: Add fchdir.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fchdir.test.
execveat-v
faccessat
fanotify_mark
+fchdir
fchmod
fchmodat
fchown
execveat-v \
faccessat \
fanotify_mark \
+ fchdir \
fchmod \
fchmodat \
fchown \
execveat.test \
faccessat.test \
fanotify_mark.test \
+ fchdir.test \
fchmod.test \
fchmodat.test \
fchown.test \
--- /dev/null
+#include "tests.h"
+#include <sys/syscall.h>
+
+#ifdef __NR_fchdir
+
+# include <errno.h>
+# include <stdio.h>
+# include <unistd.h>
+
+int
+main(void)
+{
+ const long int fd = (long int) 0xdeadbeefffffffff;
+
+ long rc = syscall(__NR_fchdir, fd);
+ printf("fchdir(%d) = %ld %s (%m)\n",
+ (int) fd, rc, errno == ENOSYS ? "ENOSYS" : "EBADF");
+
+ puts("+++ exited with 0 +++");
+ return 0;
+}
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_fchdir")
+
+#endif
--- /dev/null
+#!/bin/sh
+
+# Check fchdir syscall decoding.
+
+. "${srcdir=.}/init.sh"
+run_strace_match_diff -a11