Blame SOURCES/0142-tests-add-fchmod-y-test.patch

242c1e
From 80e96680db68fb424455180f24cd08089bd8c94b Mon Sep 17 00:00:00 2001
242c1e
From: "Dmitry V. Levin" <ldv@strace.io>
242c1e
Date: Wed, 31 Mar 2021 08:00:00 +0000
242c1e
Subject: [PATCH 142/149] tests: add fchmod-y test
242c1e
MIME-Version: 1.0
242c1e
Content-Type: text/plain; charset=UTF-8
242c1e
Content-Transfer-Encoding: 8bit
242c1e
242c1e
* tests/dirfd.c: New file.
242c1e
* tests/Makefile.am (libtests_a_SOURCES): Add dirfd.c.
242c1e
* tests/tests.h (get_dir_fd, get_fd_path): New function prototypes.
242c1e
* tests/fchmod-y.c: New file.
242c1e
* tests/fchmod.c (main): Create a sample file, handle YFLAG macro.
242c1e
* tests/gen_tests.in (fchmod-y): New entry.
242c1e
* tests/pure_executables.list: Add fchmod-y.
242c1e
* tests/.gitignore: Likewise.
242c1e
242c1e
Co-authored-by: Renaud Métrich <rmetrich@redhat.com>
242c1e
242c1e
Conflicts:
242c1e
	tests/fchmod.c
242c1e
---
242c1e
 tests/.gitignore            |  1 +
242c1e
 tests/Makefile.am           |  1 +
242c1e
 tests/dirfd.c               | 43 ++++++++++++++++++++++++++++++++++++++
242c1e
 tests/fchmod-y.c            | 10 +++++++++
242c1e
 tests/fchmod.c              | 51 ++++++++++++++++++++++++++++++++++++++-------
242c1e
 tests/gen_tests.in          |  1 +
242c1e
 tests/pure_executables.list |  1 +
242c1e
 tests/tests.h               | 12 +++++++++++
242c1e
 8 files changed, 112 insertions(+), 8 deletions(-)
242c1e
 create mode 100644 tests/dirfd.c
242c1e
 create mode 100644 tests/fchmod-y.c
242c1e
242c1e
Index: strace-5.7/tests/Makefile.am
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests/Makefile.am	2021-08-24 19:31:43.636872612 +0200
242c1e
+++ strace-5.7/tests/Makefile.am	2021-08-24 19:32:04.015700127 +0200
242c1e
@@ -31,6 +31,7 @@
242c1e
 libtests_a_SOURCES = \
242c1e
 	create_nl_socket.c \
242c1e
 	create_tmpfile.c \
242c1e
+	dirfd.c \
242c1e
 	errno2name.c \
242c1e
 	error_msg.c \
242c1e
 	fill_memory.c \
242c1e
Index: strace-5.7/tests/dirfd.c
242c1e
===================================================================
242c1e
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
242c1e
+++ strace-5.7/tests/dirfd.c	2021-08-24 19:32:04.016700119 +0200
242c1e
@@ -0,0 +1,43 @@
242c1e
+/*
242c1e
+ * Copyright (c) 2021 The strace developers.
242c1e
+ * All rights reserved.
242c1e
+ *
242c1e
+ * SPDX-License-Identifier: GPL-2.0-or-later
242c1e
+ */
242c1e
+
242c1e
+#include "tests.h"
242c1e
+
242c1e
+#include <dirent.h>
242c1e
+#include <limits.h>
242c1e
+#include <stdlib.h>
242c1e
+#include <unistd.h>
242c1e
+
242c1e
+#include "xmalloc.h"
242c1e
+
242c1e
+int
242c1e
+get_dir_fd(const char *dir_path)
242c1e
+{
242c1e
+	DIR *dir = opendir(dir_path);
242c1e
+	if (dir == NULL)
242c1e
+		perror_msg_and_fail("opendir: %s", dir_path);
242c1e
+	int dfd = dirfd(dir);
242c1e
+	if (dfd == -1)
242c1e
+		perror_msg_and_fail("dirfd");
242c1e
+	return dfd;
242c1e
+}
242c1e
+
242c1e
+char *
242c1e
+get_fd_path(int fd)
242c1e
+{
242c1e
+	char *proc = xasprintf("/proc/self/fd/%u", fd);
242c1e
+	char *buf = xmalloc(PATH_MAX);
242c1e
+	ssize_t n = readlink(proc, buf, PATH_MAX);
242c1e
+	if (n < 0)
242c1e
+		perror_msg_and_skip("readlink: %s", proc);
242c1e
+	if (n >= PATH_MAX)
242c1e
+		error_msg_and_fail("readlink: %s: %s", proc,
242c1e
+				   "symlink value is too long");
242c1e
+	buf[n] = '\0';
242c1e
+	free(proc);
242c1e
+	return buf;
242c1e
+}
242c1e
Index: strace-5.7/tests/fchmod-y.c
242c1e
===================================================================
242c1e
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
242c1e
+++ strace-5.7/tests/fchmod-y.c	2021-08-24 19:32:04.016700119 +0200
242c1e
@@ -0,0 +1,10 @@
242c1e
+/*
242c1e
+ * Copyright (c) 2021 The strace developers.
242c1e
+ * All rights reserved.
242c1e
+ *
242c1e
+ * SPDX-License-Identifier: GPL-2.0-or-later
242c1e
+ */
242c1e
+
242c1e
+#define YFLAG
242c1e
+
242c1e
+#include "fchmod.c"
242c1e
Index: strace-5.7/tests/fchmod.c
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests/fchmod.c	2021-08-24 19:31:43.636872612 +0200
242c1e
+++ strace-5.7/tests/fchmod.c	2021-08-24 19:32:04.017700110 +0200
242c1e
@@ -2,8 +2,8 @@
242c1e
  * Check decoding of fchmod syscall.
242c1e
  *
242c1e
  * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
242c1e
- * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
242c1e
- * Copyright (c) 2016-2020 The strace developers.
242c1e
+ * Copyright (c) 2016 Dmitry V. Levin <ldv@strace.io>
242c1e
+ * Copyright (c) 2016-2021 The strace developers.
242c1e
  * All rights reserved.
242c1e
  *
242c1e
  * SPDX-License-Identifier: GPL-2.0-or-later
242c1e
@@ -15,25 +15,60 @@
242c1e
 #ifdef __NR_fchmod
242c1e
 
242c1e
 # include <fcntl.h>
242c1e
-# include <sys/stat.h>
242c1e
 # include <stdio.h>
242c1e
 # include <unistd.h>
242c1e
 
242c1e
 int
242c1e
 main(void)
242c1e
 {
242c1e
-	int fd = create_tmpfile(O_RDWR);
242c1e
+	static const char sample[] = "fchmod_sample_file";
242c1e
+	(void) unlink(sample);
242c1e
+	int fd = open(sample, O_CREAT|O_RDONLY, 0400);
242c1e
+	if (fd == -1)
242c1e
+		perror_msg_and_fail("open");
242c1e
+
242c1e
+# ifdef YFLAG
242c1e
+	char *sample_realpath = get_fd_path(fd);
242c1e
+# endif
242c1e
 
242c1e
 	long rc = syscall(__NR_fchmod, fd, 0600);
242c1e
-	printf("fchmod(%d, 0600) = %s\n", fd, sprintrc(rc));
242c1e
+# ifdef YFLAG
242c1e
+	printf("fchmod(%d<%s>, 0600) = %s\n",
242c1e
+# else
242c1e
+	printf("fchmod(%d, 0600) = %s\n",
242c1e
+# endif
242c1e
+	       fd,
242c1e
+# ifdef YFLAG
242c1e
+	       sample_realpath,
242c1e
+# endif
242c1e
+	       sprintrc(rc));
242c1e
 
242c1e
-	close(fd);
242c1e
+	if (unlink(sample))
242c1e
+		perror_msg_and_fail("unlink");
242c1e
 
242c1e
 	rc = syscall(__NR_fchmod, fd, 051);
242c1e
-	printf("fchmod(%d, 051) = %s\n", fd, sprintrc(rc));
242c1e
+# ifdef YFLAG
242c1e
+	printf("fchmod(%d<%s (deleted)>, 051) = %s\n",
242c1e
+# else
242c1e
+	printf("fchmod(%d, 051) = %s\n",
242c1e
+# endif
242c1e
+	       fd,
242c1e
+# ifdef YFLAG
242c1e
+	       sample_realpath,
242c1e
+# endif
242c1e
+	       sprintrc(rc));
242c1e
 
242c1e
 	rc = syscall(__NR_fchmod, fd, 004);
242c1e
-	printf("fchmod(%d, 004) = %s\n", fd, sprintrc(rc));
242c1e
+# ifdef YFLAG
242c1e
+	printf("fchmod(%d<%s (deleted)>, 004) = %s\n",
242c1e
+# else
242c1e
+	printf("fchmod(%d, 004) = %s\n",
242c1e
+# endif
242c1e
+	       fd,
242c1e
+# ifdef YFLAG
242c1e
+	       sample_realpath,
242c1e
+# endif
242c1e
+	       sprintrc(rc));
242c1e
 
242c1e
 	puts("+++ exited with 0 +++");
242c1e
 	return 0;
242c1e
Index: strace-5.7/tests/gen_tests.in
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests/gen_tests.in	2021-08-24 19:31:43.637872604 +0200
242c1e
+++ strace-5.7/tests/gen_tests.in	2021-08-24 19:32:04.017700110 +0200
242c1e
@@ -83,6 +83,7 @@
242c1e
 fanotify_mark-Xverbose	-a32 -Xverbose -e trace=fanotify_mark
242c1e
 fchdir	-a11
242c1e
 fchmod	-a15
242c1e
+fchmod-y	-y -e trace=fchmod
242c1e
 fchmodat
242c1e
 fchown	-a16
242c1e
 fchown32	-a18
242c1e
Index: strace-5.7/tests/pure_executables.list
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests/pure_executables.list	2021-08-24 19:31:43.637872604 +0200
242c1e
+++ strace-5.7/tests/pure_executables.list	2021-08-24 19:32:04.017700110 +0200
242c1e
@@ -71,6 +71,7 @@
242c1e
 fanotify_mark-Xverbose
242c1e
 fchdir
242c1e
 fchmod
242c1e
+fchmod-y
242c1e
 fchmodat
242c1e
 fchown
242c1e
 fchown32
242c1e
Index: strace-5.7/tests/tests.h
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests/tests.h	2021-08-24 19:31:43.637872604 +0200
242c1e
+++ strace-5.7/tests/tests.h	2021-08-24 19:32:04.018700102 +0200
242c1e
@@ -149,6 +149,18 @@
242c1e
 void skip_if_unavailable(const char *);
242c1e
 
242c1e
 /*
242c1e
+ * Obtain a file descriptor corresponding to the specified directory name,
242c1e
+ * die on failure.
242c1e
+ */
242c1e
+int get_dir_fd(const char *dir_path);
242c1e
+
242c1e
+/*
242c1e
+ * Obtain a path corresponding to the specified file descriptor,
242c1e
+ * die on failure.
242c1e
+ */
242c1e
+char *get_fd_path(int fd) ATTRIBUTE_MALLOC;
242c1e
+
242c1e
+/*
242c1e
  * Obtain an exclusive lock on dirname(path_name)/lock_name file
242c1e
  * using open and flock.
242c1e
  */
242c1e
Index: strace-5.7/tests-m32/Makefile.am
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests-m32/Makefile.am	2021-08-24 19:31:43.637872604 +0200
242c1e
+++ strace-5.7/tests-m32/Makefile.am	2021-08-24 19:32:04.018700102 +0200
242c1e
@@ -31,6 +31,7 @@
242c1e
 libtests_a_SOURCES = \
242c1e
 	create_nl_socket.c \
242c1e
 	create_tmpfile.c \
242c1e
+	dirfd.c \
242c1e
 	errno2name.c \
242c1e
 	error_msg.c \
242c1e
 	fill_memory.c \
242c1e
Index: strace-5.7/tests-m32/dirfd.c
242c1e
===================================================================
242c1e
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
242c1e
+++ strace-5.7/tests-m32/dirfd.c	2021-08-24 19:32:04.018700102 +0200
242c1e
@@ -0,0 +1,43 @@
242c1e
+/*
242c1e
+ * Copyright (c) 2021 The strace developers.
242c1e
+ * All rights reserved.
242c1e
+ *
242c1e
+ * SPDX-License-Identifier: GPL-2.0-or-later
242c1e
+ */
242c1e
+
242c1e
+#include "tests.h"
242c1e
+
242c1e
+#include <dirent.h>
242c1e
+#include <limits.h>
242c1e
+#include <stdlib.h>
242c1e
+#include <unistd.h>
242c1e
+
242c1e
+#include "xmalloc.h"
242c1e
+
242c1e
+int
242c1e
+get_dir_fd(const char *dir_path)
242c1e
+{
242c1e
+	DIR *dir = opendir(dir_path);
242c1e
+	if (dir == NULL)
242c1e
+		perror_msg_and_fail("opendir: %s", dir_path);
242c1e
+	int dfd = dirfd(dir);
242c1e
+	if (dfd == -1)
242c1e
+		perror_msg_and_fail("dirfd");
242c1e
+	return dfd;
242c1e
+}
242c1e
+
242c1e
+char *
242c1e
+get_fd_path(int fd)
242c1e
+{
242c1e
+	char *proc = xasprintf("/proc/self/fd/%u", fd);
242c1e
+	char *buf = xmalloc(PATH_MAX);
242c1e
+	ssize_t n = readlink(proc, buf, PATH_MAX);
242c1e
+	if (n < 0)
242c1e
+		perror_msg_and_skip("readlink: %s", proc);
242c1e
+	if (n >= PATH_MAX)
242c1e
+		error_msg_and_fail("readlink: %s: %s", proc,
242c1e
+				   "symlink value is too long");
242c1e
+	buf[n] = '\0';
242c1e
+	free(proc);
242c1e
+	return buf;
242c1e
+}
242c1e
Index: strace-5.7/tests-m32/fchmod-y.c
242c1e
===================================================================
242c1e
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
242c1e
+++ strace-5.7/tests-m32/fchmod-y.c	2021-08-24 19:32:04.019700094 +0200
242c1e
@@ -0,0 +1,10 @@
242c1e
+/*
242c1e
+ * Copyright (c) 2021 The strace developers.
242c1e
+ * All rights reserved.
242c1e
+ *
242c1e
+ * SPDX-License-Identifier: GPL-2.0-or-later
242c1e
+ */
242c1e
+
242c1e
+#define YFLAG
242c1e
+
242c1e
+#include "fchmod.c"
242c1e
Index: strace-5.7/tests-m32/fchmod.c
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests-m32/fchmod.c	2021-08-24 19:31:43.638872595 +0200
242c1e
+++ strace-5.7/tests-m32/fchmod.c	2021-08-24 19:32:04.019700094 +0200
242c1e
@@ -2,8 +2,8 @@
242c1e
  * Check decoding of fchmod syscall.
242c1e
  *
242c1e
  * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
242c1e
- * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
242c1e
- * Copyright (c) 2016-2020 The strace developers.
242c1e
+ * Copyright (c) 2016 Dmitry V. Levin <ldv@strace.io>
242c1e
+ * Copyright (c) 2016-2021 The strace developers.
242c1e
  * All rights reserved.
242c1e
  *
242c1e
  * SPDX-License-Identifier: GPL-2.0-or-later
242c1e
@@ -15,25 +15,60 @@
242c1e
 #ifdef __NR_fchmod
242c1e
 
242c1e
 # include <fcntl.h>
242c1e
-# include <sys/stat.h>
242c1e
 # include <stdio.h>
242c1e
 # include <unistd.h>
242c1e
 
242c1e
 int
242c1e
 main(void)
242c1e
 {
242c1e
-	int fd = create_tmpfile(O_RDWR);
242c1e
+	static const char sample[] = "fchmod_sample_file";
242c1e
+	(void) unlink(sample);
242c1e
+	int fd = open(sample, O_CREAT|O_RDONLY, 0400);
242c1e
+	if (fd == -1)
242c1e
+		perror_msg_and_fail("open");
242c1e
+
242c1e
+# ifdef YFLAG
242c1e
+	char *sample_realpath = get_fd_path(fd);
242c1e
+# endif
242c1e
 
242c1e
 	long rc = syscall(__NR_fchmod, fd, 0600);
242c1e
-	printf("fchmod(%d, 0600) = %s\n", fd, sprintrc(rc));
242c1e
+# ifdef YFLAG
242c1e
+	printf("fchmod(%d<%s>, 0600) = %s\n",
242c1e
+# else
242c1e
+	printf("fchmod(%d, 0600) = %s\n",
242c1e
+# endif
242c1e
+	       fd,
242c1e
+# ifdef YFLAG
242c1e
+	       sample_realpath,
242c1e
+# endif
242c1e
+	       sprintrc(rc));
242c1e
 
242c1e
-	close(fd);
242c1e
+	if (unlink(sample))
242c1e
+		perror_msg_and_fail("unlink");
242c1e
 
242c1e
 	rc = syscall(__NR_fchmod, fd, 051);
242c1e
-	printf("fchmod(%d, 051) = %s\n", fd, sprintrc(rc));
242c1e
+# ifdef YFLAG
242c1e
+	printf("fchmod(%d<%s (deleted)>, 051) = %s\n",
242c1e
+# else
242c1e
+	printf("fchmod(%d, 051) = %s\n",
242c1e
+# endif
242c1e
+	       fd,
242c1e
+# ifdef YFLAG
242c1e
+	       sample_realpath,
242c1e
+# endif
242c1e
+	       sprintrc(rc));
242c1e
 
242c1e
 	rc = syscall(__NR_fchmod, fd, 004);
242c1e
-	printf("fchmod(%d, 004) = %s\n", fd, sprintrc(rc));
242c1e
+# ifdef YFLAG
242c1e
+	printf("fchmod(%d<%s (deleted)>, 004) = %s\n",
242c1e
+# else
242c1e
+	printf("fchmod(%d, 004) = %s\n",
242c1e
+# endif
242c1e
+	       fd,
242c1e
+# ifdef YFLAG
242c1e
+	       sample_realpath,
242c1e
+# endif
242c1e
+	       sprintrc(rc));
242c1e
 
242c1e
 	puts("+++ exited with 0 +++");
242c1e
 	return 0;
242c1e
Index: strace-5.7/tests-m32/gen_tests.in
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests-m32/gen_tests.in	2021-08-24 19:31:43.638872595 +0200
242c1e
+++ strace-5.7/tests-m32/gen_tests.in	2021-08-24 19:32:04.020700085 +0200
242c1e
@@ -83,6 +83,7 @@
242c1e
 fanotify_mark-Xverbose	-a32 -Xverbose -e trace=fanotify_mark
242c1e
 fchdir	-a11
242c1e
 fchmod	-a15
242c1e
+fchmod-y	-y -e trace=fchmod
242c1e
 fchmodat
242c1e
 fchown	-a16
242c1e
 fchown32	-a18
242c1e
Index: strace-5.7/tests-m32/pure_executables.list
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests-m32/pure_executables.list	2021-08-24 19:31:43.638872595 +0200
242c1e
+++ strace-5.7/tests-m32/pure_executables.list	2021-08-24 19:32:04.020700085 +0200
242c1e
@@ -71,6 +71,7 @@
242c1e
 fanotify_mark-Xverbose
242c1e
 fchdir
242c1e
 fchmod
242c1e
+fchmod-y
242c1e
 fchmodat
242c1e
 fchown
242c1e
 fchown32
242c1e
Index: strace-5.7/tests-m32/tests.h
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests-m32/tests.h	2021-08-24 19:31:43.638872595 +0200
242c1e
+++ strace-5.7/tests-m32/tests.h	2021-08-24 19:32:04.020700085 +0200
242c1e
@@ -149,6 +149,18 @@
242c1e
 void skip_if_unavailable(const char *);
242c1e
 
242c1e
 /*
242c1e
+ * Obtain a file descriptor corresponding to the specified directory name,
242c1e
+ * die on failure.
242c1e
+ */
242c1e
+int get_dir_fd(const char *dir_path);
242c1e
+
242c1e
+/*
242c1e
+ * Obtain a path corresponding to the specified file descriptor,
242c1e
+ * die on failure.
242c1e
+ */
242c1e
+char *get_fd_path(int fd) ATTRIBUTE_MALLOC;
242c1e
+
242c1e
+/*
242c1e
  * Obtain an exclusive lock on dirname(path_name)/lock_name file
242c1e
  * using open and flock.
242c1e
  */
242c1e
Index: strace-5.7/tests-mx32/Makefile.am
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests-mx32/Makefile.am	2021-08-24 19:31:43.638872595 +0200
242c1e
+++ strace-5.7/tests-mx32/Makefile.am	2021-08-24 19:32:04.021700077 +0200
242c1e
@@ -31,6 +31,7 @@
242c1e
 libtests_a_SOURCES = \
242c1e
 	create_nl_socket.c \
242c1e
 	create_tmpfile.c \
242c1e
+	dirfd.c \
242c1e
 	errno2name.c \
242c1e
 	error_msg.c \
242c1e
 	fill_memory.c \
242c1e
Index: strace-5.7/tests-mx32/dirfd.c
242c1e
===================================================================
242c1e
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
242c1e
+++ strace-5.7/tests-mx32/dirfd.c	2021-08-24 19:32:04.021700077 +0200
242c1e
@@ -0,0 +1,43 @@
242c1e
+/*
242c1e
+ * Copyright (c) 2021 The strace developers.
242c1e
+ * All rights reserved.
242c1e
+ *
242c1e
+ * SPDX-License-Identifier: GPL-2.0-or-later
242c1e
+ */
242c1e
+
242c1e
+#include "tests.h"
242c1e
+
242c1e
+#include <dirent.h>
242c1e
+#include <limits.h>
242c1e
+#include <stdlib.h>
242c1e
+#include <unistd.h>
242c1e
+
242c1e
+#include "xmalloc.h"
242c1e
+
242c1e
+int
242c1e
+get_dir_fd(const char *dir_path)
242c1e
+{
242c1e
+	DIR *dir = opendir(dir_path);
242c1e
+	if (dir == NULL)
242c1e
+		perror_msg_and_fail("opendir: %s", dir_path);
242c1e
+	int dfd = dirfd(dir);
242c1e
+	if (dfd == -1)
242c1e
+		perror_msg_and_fail("dirfd");
242c1e
+	return dfd;
242c1e
+}
242c1e
+
242c1e
+char *
242c1e
+get_fd_path(int fd)
242c1e
+{
242c1e
+	char *proc = xasprintf("/proc/self/fd/%u", fd);
242c1e
+	char *buf = xmalloc(PATH_MAX);
242c1e
+	ssize_t n = readlink(proc, buf, PATH_MAX);
242c1e
+	if (n < 0)
242c1e
+		perror_msg_and_skip("readlink: %s", proc);
242c1e
+	if (n >= PATH_MAX)
242c1e
+		error_msg_and_fail("readlink: %s: %s", proc,
242c1e
+				   "symlink value is too long");
242c1e
+	buf[n] = '\0';
242c1e
+	free(proc);
242c1e
+	return buf;
242c1e
+}
242c1e
Index: strace-5.7/tests-mx32/fchmod-y.c
242c1e
===================================================================
242c1e
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
242c1e
+++ strace-5.7/tests-mx32/fchmod-y.c	2021-08-24 19:32:04.021700077 +0200
242c1e
@@ -0,0 +1,10 @@
242c1e
+/*
242c1e
+ * Copyright (c) 2021 The strace developers.
242c1e
+ * All rights reserved.
242c1e
+ *
242c1e
+ * SPDX-License-Identifier: GPL-2.0-or-later
242c1e
+ */
242c1e
+
242c1e
+#define YFLAG
242c1e
+
242c1e
+#include "fchmod.c"
242c1e
Index: strace-5.7/tests-mx32/fchmod.c
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests-mx32/fchmod.c	2021-08-24 19:31:43.639872587 +0200
242c1e
+++ strace-5.7/tests-mx32/fchmod.c	2021-08-24 19:32:04.022700068 +0200
242c1e
@@ -2,8 +2,8 @@
242c1e
  * Check decoding of fchmod syscall.
242c1e
  *
242c1e
  * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
242c1e
- * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
242c1e
- * Copyright (c) 2016-2020 The strace developers.
242c1e
+ * Copyright (c) 2016 Dmitry V. Levin <ldv@strace.io>
242c1e
+ * Copyright (c) 2016-2021 The strace developers.
242c1e
  * All rights reserved.
242c1e
  *
242c1e
  * SPDX-License-Identifier: GPL-2.0-or-later
242c1e
@@ -15,25 +15,60 @@
242c1e
 #ifdef __NR_fchmod
242c1e
 
242c1e
 # include <fcntl.h>
242c1e
-# include <sys/stat.h>
242c1e
 # include <stdio.h>
242c1e
 # include <unistd.h>
242c1e
 
242c1e
 int
242c1e
 main(void)
242c1e
 {
242c1e
-	int fd = create_tmpfile(O_RDWR);
242c1e
+	static const char sample[] = "fchmod_sample_file";
242c1e
+	(void) unlink(sample);
242c1e
+	int fd = open(sample, O_CREAT|O_RDONLY, 0400);
242c1e
+	if (fd == -1)
242c1e
+		perror_msg_and_fail("open");
242c1e
+
242c1e
+# ifdef YFLAG
242c1e
+	char *sample_realpath = get_fd_path(fd);
242c1e
+# endif
242c1e
 
242c1e
 	long rc = syscall(__NR_fchmod, fd, 0600);
242c1e
-	printf("fchmod(%d, 0600) = %s\n", fd, sprintrc(rc));
242c1e
+# ifdef YFLAG
242c1e
+	printf("fchmod(%d<%s>, 0600) = %s\n",
242c1e
+# else
242c1e
+	printf("fchmod(%d, 0600) = %s\n",
242c1e
+# endif
242c1e
+	       fd,
242c1e
+# ifdef YFLAG
242c1e
+	       sample_realpath,
242c1e
+# endif
242c1e
+	       sprintrc(rc));
242c1e
 
242c1e
-	close(fd);
242c1e
+	if (unlink(sample))
242c1e
+		perror_msg_and_fail("unlink");
242c1e
 
242c1e
 	rc = syscall(__NR_fchmod, fd, 051);
242c1e
-	printf("fchmod(%d, 051) = %s\n", fd, sprintrc(rc));
242c1e
+# ifdef YFLAG
242c1e
+	printf("fchmod(%d<%s (deleted)>, 051) = %s\n",
242c1e
+# else
242c1e
+	printf("fchmod(%d, 051) = %s\n",
242c1e
+# endif
242c1e
+	       fd,
242c1e
+# ifdef YFLAG
242c1e
+	       sample_realpath,
242c1e
+# endif
242c1e
+	       sprintrc(rc));
242c1e
 
242c1e
 	rc = syscall(__NR_fchmod, fd, 004);
242c1e
-	printf("fchmod(%d, 004) = %s\n", fd, sprintrc(rc));
242c1e
+# ifdef YFLAG
242c1e
+	printf("fchmod(%d<%s (deleted)>, 004) = %s\n",
242c1e
+# else
242c1e
+	printf("fchmod(%d, 004) = %s\n",
242c1e
+# endif
242c1e
+	       fd,
242c1e
+# ifdef YFLAG
242c1e
+	       sample_realpath,
242c1e
+# endif
242c1e
+	       sprintrc(rc));
242c1e
 
242c1e
 	puts("+++ exited with 0 +++");
242c1e
 	return 0;
242c1e
Index: strace-5.7/tests-mx32/gen_tests.in
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests-mx32/gen_tests.in	2021-08-24 19:31:43.639872587 +0200
242c1e
+++ strace-5.7/tests-mx32/gen_tests.in	2021-08-24 19:32:04.022700068 +0200
242c1e
@@ -83,6 +83,7 @@
242c1e
 fanotify_mark-Xverbose	-a32 -Xverbose -e trace=fanotify_mark
242c1e
 fchdir	-a11
242c1e
 fchmod	-a15
242c1e
+fchmod-y	-y -e trace=fchmod
242c1e
 fchmodat
242c1e
 fchown	-a16
242c1e
 fchown32	-a18
242c1e
Index: strace-5.7/tests-mx32/pure_executables.list
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests-mx32/pure_executables.list	2021-08-24 19:31:43.639872587 +0200
242c1e
+++ strace-5.7/tests-mx32/pure_executables.list	2021-08-24 19:32:04.022700068 +0200
242c1e
@@ -71,6 +71,7 @@
242c1e
 fanotify_mark-Xverbose
242c1e
 fchdir
242c1e
 fchmod
242c1e
+fchmod-y
242c1e
 fchmodat
242c1e
 fchown
242c1e
 fchown32
242c1e
Index: strace-5.7/tests-mx32/tests.h
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests-mx32/tests.h	2021-08-24 19:31:43.639872587 +0200
242c1e
+++ strace-5.7/tests-mx32/tests.h	2021-08-24 19:32:04.022700068 +0200
242c1e
@@ -149,6 +149,18 @@
242c1e
 void skip_if_unavailable(const char *);
242c1e
 
242c1e
 /*
242c1e
+ * Obtain a file descriptor corresponding to the specified directory name,
242c1e
+ * die on failure.
242c1e
+ */
242c1e
+int get_dir_fd(const char *dir_path);
242c1e
+
242c1e
+/*
242c1e
+ * Obtain a path corresponding to the specified file descriptor,
242c1e
+ * die on failure.
242c1e
+ */
242c1e
+char *get_fd_path(int fd) ATTRIBUTE_MALLOC;
242c1e
+
242c1e
+/*
242c1e
  * Obtain an exclusive lock on dirname(path_name)/lock_name file
242c1e
  * using open and flock.
242c1e
  */
242c1e
Index: strace-5.7/tests/Makefile.in
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests/Makefile.in	2021-08-24 19:31:43.647872519 +0200
242c1e
+++ strace-5.7/tests/Makefile.in	2021-08-24 19:35:06.722153713 +0200
242c1e
@@ -303,7 +303,7 @@
242c1e
 	fanotify_init$(EXEEXT) fanotify_mark$(EXEEXT) \
242c1e
 	fanotify_mark-Xabbrev$(EXEEXT) fanotify_mark-Xraw$(EXEEXT) \
242c1e
 	fanotify_mark-Xverbose$(EXEEXT) fchdir$(EXEEXT) \
242c1e
-	fchmod$(EXEEXT) fchmodat$(EXEEXT) fchown$(EXEEXT) \
242c1e
+	fchmod$(EXEEXT) fchmod-y$(EXEEXT) fchmodat$(EXEEXT) fchown$(EXEEXT) \
242c1e
 	fchown32$(EXEEXT) fchownat$(EXEEXT) fcntl$(EXEEXT) \
242c1e
 	fcntl64$(EXEEXT) fdatasync$(EXEEXT) fflush$(EXEEXT) \
242c1e
 	file_handle$(EXEEXT) file_ioctl$(EXEEXT) finit_module$(EXEEXT) \
242c1e
@@ -551,7 +551,7 @@
242c1e
 libtests_a_AR = $(AR) $(ARFLAGS)
242c1e
 libtests_a_LIBADD =
242c1e
 am_libtests_a_OBJECTS = libtests_a-create_nl_socket.$(OBJEXT) \
242c1e
-	libtests_a-create_tmpfile.$(OBJEXT) \
242c1e
+	libtests_a-create_tmpfile.$(OBJEXT) libtests_a-dirfd.$(OBJEXT) \
242c1e
 	libtests_a-errno2name.$(OBJEXT) libtests_a-error_msg.$(OBJEXT) \
242c1e
 	libtests_a-fill_memory.$(OBJEXT) \
242c1e
 	libtests_a-get_page_size.$(OBJEXT) \
242c1e
@@ -986,6 +986,10 @@
242c1e
 fchmod_OBJECTS = fchmod.$(OBJEXT)
242c1e
 fchmod_LDADD = $(LDADD)
242c1e
 fchmod_DEPENDENCIES = libtests.a
242c1e
+fchmod_y_SOURCES = fchmod-y.c
242c1e
+fchmod_y_OBJECTS = fchmod-y.$(OBJEXT)
242c1e
+fchmod_y_LDADD = $(LDADD)
242c1e
+fchmod_y_DEPENDENCIES = libtests.a
242c1e
 fchmodat_SOURCES = fchmodat.c
242c1e
 fchmodat_OBJECTS = fchmodat.$(OBJEXT)
242c1e
 fchmodat_LDADD = $(LDADD)
242c1e
@@ -4508,9 +4512,10 @@
242c1e
 	execve-v.c execveat.c execveat-v.c faccessat.c fadvise64.c \
242c1e
 	fadvise64_64.c fallocate.c fanotify_init.c fanotify_mark.c \
242c1e
 	fanotify_mark-Xabbrev.c fanotify_mark-Xraw.c \
242c1e
-	fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmodat.c fchown.c \
242c1e
-	fchown32.c fchownat.c fcntl.c fcntl--pidns-translation.c \
242c1e
-	fcntl64.c fcntl64--pidns-translation.c fdatasync.c fflush.c \
242c1e
+	fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmod-y.c \
242c1e
+	fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c \
242c1e
+	fcntl--pidns-translation.c fcntl64.c \
242c1e
+	fcntl64--pidns-translation.c fdatasync.c fflush.c \
242c1e
 	file_handle.c file_ioctl.c filter-unavailable.c \
242c1e
 	filter_seccomp-flag.c filter_seccomp-perf.c finit_module.c \
242c1e
 	flock.c fork--pidns-translation.c fork-f.c fsconfig.c \
242c1e
@@ -4755,9 +4760,10 @@
242c1e
 	execve-v.c execveat.c execveat-v.c faccessat.c fadvise64.c \
242c1e
 	fadvise64_64.c fallocate.c fanotify_init.c fanotify_mark.c \
242c1e
 	fanotify_mark-Xabbrev.c fanotify_mark-Xraw.c \
242c1e
-	fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmodat.c fchown.c \
242c1e
-	fchown32.c fchownat.c fcntl.c fcntl--pidns-translation.c \
242c1e
-	fcntl64.c fcntl64--pidns-translation.c fdatasync.c fflush.c \
242c1e
+	fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmod-y.c \
242c1e
+	fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c \
242c1e
+	fcntl--pidns-translation.c fcntl64.c \
242c1e
+	fcntl64--pidns-translation.c fdatasync.c fflush.c \
242c1e
 	file_handle.c file_ioctl.c filter-unavailable.c \
242c1e
 	filter_seccomp-flag.c filter_seccomp-perf.c finit_module.c \
242c1e
 	flock.c fork--pidns-translation.c fork-f.c fsconfig.c \
242c1e
@@ -5397,6 +5403,7 @@
242c1e
 libtests_a_SOURCES = \
242c1e
 	create_nl_socket.c \
242c1e
 	create_tmpfile.c \
242c1e
+	dirfd.c \
242c1e
 	errno2name.c \
242c1e
 	error_msg.c \
242c1e
 	fill_memory.c \
242c1e
@@ -5507,6 +5514,7 @@
242c1e
   fanotify_mark-Xverbose \
242c1e
   fchdir \
242c1e
   fchmod \
242c1e
+  fchmod-y \
242c1e
   fchmodat \
242c1e
   fchown \
242c1e
   fchown32 \
242c1e
@@ -6151,11 +6159,11 @@
242c1e
 	fanotify_init.gen.test fanotify_mark.gen.test \
242c1e
 	fanotify_mark-Xabbrev.gen.test fanotify_mark-Xraw.gen.test \
242c1e
 	fanotify_mark-Xverbose.gen.test fchdir.gen.test \
242c1e
-	fchmod.gen.test fchmodat.gen.test fchown.gen.test \
242c1e
-	fchown32.gen.test fchownat.gen.test fcntl.gen.test \
242c1e
-	fcntl--pidns-translation.gen.test fcntl64.gen.test \
242c1e
-	fcntl64--pidns-translation.gen.test fdatasync.gen.test \
242c1e
-	file_handle.gen.test file_ioctl.gen.test \
242c1e
+	fchmod.gen.test fchmod-y.gen.test fchmodat.gen.test \
242c1e
+	fchown.gen.test fchown32.gen.test fchownat.gen.test \
242c1e
+	fcntl.gen.test fcntl--pidns-translation.gen.test \
242c1e
+	fcntl64.gen.test fcntl64--pidns-translation.gen.test \
242c1e
+	fdatasync.gen.test file_handle.gen.test file_ioctl.gen.test \
242c1e
 	filter_seccomp.gen.test filter_seccomp-flag.gen.test \
242c1e
 	finit_module.gen.test flock.gen.test fork-f.gen.test \
242c1e
 	fsconfig.gen.test fsconfig-P.gen.test fsmount.gen.test \
242c1e
@@ -7242,6 +7250,10 @@
242c1e
 	@rm -f fchmod$(EXEEXT)
242c1e
 	$(AM_V_CCLD)$(LINK) $(fchmod_OBJECTS) $(fchmod_LDADD) $(LIBS)
242c1e
 
242c1e
+fchmod-y$(EXEEXT): $(fchmod_y_OBJECTS) $(fchmod_y_DEPENDENCIES) $(EXTRA_fchmod_y_DEPENDENCIES) 
242c1e
+	@rm -f fchmod-y$(EXEEXT)
242c1e
+	$(AM_V_CCLD)$(LINK) $(fchmod_y_OBJECTS) $(fchmod_y_LDADD) $(LIBS)
242c1e
+
242c1e
 fchmodat$(EXEEXT): $(fchmodat_OBJECTS) $(fchmodat_DEPENDENCIES) $(EXTRA_fchmodat_DEPENDENCIES) 
242c1e
 	@rm -f fchmodat$(EXEEXT)
242c1e
 	$(AM_V_CCLD)$(LINK) $(fchmodat_OBJECTS) $(fchmodat_LDADD) $(LIBS)
242c1e
@@ -10176,6 +10188,7 @@
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark-Xverbose.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchdir.Po@am__quote@ # am--include-marker
242c1e
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmod-y.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmod.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmodat.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown.Po@am__quote@ # am--include-marker
242c1e
@@ -10394,6 +10407,7 @@
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown32.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-create_nl_socket.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-create_tmpfile.Po@am__quote@ # am--include-marker
242c1e
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-dirfd.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-errno2name.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-error_msg.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-fill_memory.Po@am__quote@ # am--include-marker
242c1e
@@ -10975,6 +10989,20 @@
242c1e
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
242c1e
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-create_tmpfile.obj `if test -f 'create_tmpfile.c'; then $(CYGPATH_W) 'create_tmpfile.c'; else $(CYGPATH_W) '$(srcdir)/create_tmpfile.c'; fi`
242c1e
 
242c1e
+libtests_a-dirfd.o: dirfd.c
242c1e
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-dirfd.o -MD -MP -MF $(DEPDIR)/libtests_a-dirfd.Tpo -c -o libtests_a-dirfd.o `test -f 'dirfd.c' || echo '$(srcdir)/'`dirfd.c
242c1e
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-dirfd.Tpo $(DEPDIR)/libtests_a-dirfd.Po
242c1e
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='dirfd.c' object='libtests_a-dirfd.o' libtool=no @AMDEPBACKSLASH@
242c1e
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
242c1e
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-dirfd.o `test -f 'dirfd.c' || echo '$(srcdir)/'`dirfd.c
242c1e
+
242c1e
+libtests_a-dirfd.obj: dirfd.c
242c1e
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-dirfd.obj -MD -MP -MF $(DEPDIR)/libtests_a-dirfd.Tpo -c -o libtests_a-dirfd.obj `if test -f 'dirfd.c'; then $(CYGPATH_W) 'dirfd.c'; else $(CYGPATH_W) '$(srcdir)/dirfd.c'; fi`
242c1e
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-dirfd.Tpo $(DEPDIR)/libtests_a-dirfd.Po
242c1e
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='dirfd.c' object='libtests_a-dirfd.obj' libtool=no @AMDEPBACKSLASH@
242c1e
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
242c1e
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-dirfd.obj `if test -f 'dirfd.c'; then $(CYGPATH_W) 'dirfd.c'; else $(CYGPATH_W) '$(srcdir)/dirfd.c'; fi`
242c1e
+
242c1e
 libtests_a-errno2name.o: errno2name.c
242c1e
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-errno2name.o -MD -MP -MF $(DEPDIR)/libtests_a-errno2name.Tpo -c -o libtests_a-errno2name.o `test -f 'errno2name.c' || echo '$(srcdir)/'`errno2name.c
242c1e
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-errno2name.Tpo $(DEPDIR)/libtests_a-errno2name.Po
242c1e
@@ -14015,6 +14043,9 @@
242c1e
 $(srcdir)/fchmod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in
242c1e
 	$(AM_V_GEN) $^ $@
242c1e
 
242c1e
+$(srcdir)/fchmod-y.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in
242c1e
+	$(AM_V_GEN) $^ $@
242c1e
+
242c1e
 $(srcdir)/fchmodat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in
242c1e
 	$(AM_V_GEN) $^ $@
242c1e
 
242c1e
Index: strace-5.7/tests-m32/Makefile.in
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests-m32/Makefile.in	2021-08-24 19:31:43.655872452 +0200
242c1e
+++ strace-5.7/tests-m32/Makefile.in	2021-08-24 19:32:04.034699967 +0200
242c1e
@@ -303,7 +303,7 @@
242c1e
 	fanotify_init$(EXEEXT) fanotify_mark$(EXEEXT) \
242c1e
 	fanotify_mark-Xabbrev$(EXEEXT) fanotify_mark-Xraw$(EXEEXT) \
242c1e
 	fanotify_mark-Xverbose$(EXEEXT) fchdir$(EXEEXT) \
242c1e
-	fchmod$(EXEEXT) fchmodat$(EXEEXT) fchown$(EXEEXT) \
242c1e
+	fchmod$(EXEEXT) fchmod-y$(EXEEXT) fchmodat$(EXEEXT) fchown$(EXEEXT) \
242c1e
 	fchown32$(EXEEXT) fchownat$(EXEEXT) fcntl$(EXEEXT) \
242c1e
 	fcntl64$(EXEEXT) fdatasync$(EXEEXT) fflush$(EXEEXT) \
242c1e
 	file_handle$(EXEEXT) file_ioctl$(EXEEXT) finit_module$(EXEEXT) \
242c1e
@@ -551,7 +551,7 @@
242c1e
 libtests_a_AR = $(AR) $(ARFLAGS)
242c1e
 libtests_a_LIBADD =
242c1e
 am_libtests_a_OBJECTS = libtests_a-create_nl_socket.$(OBJEXT) \
242c1e
-	libtests_a-create_tmpfile.$(OBJEXT) \
242c1e
+	libtests_a-create_tmpfile.$(OBJEXT) libtests_a-dirfd.$(OBJEXT) \
242c1e
 	libtests_a-errno2name.$(OBJEXT) libtests_a-error_msg.$(OBJEXT) \
242c1e
 	libtests_a-fill_memory.$(OBJEXT) \
242c1e
 	libtests_a-get_page_size.$(OBJEXT) \
242c1e
@@ -986,6 +986,10 @@
242c1e
 fchmod_OBJECTS = fchmod.$(OBJEXT)
242c1e
 fchmod_LDADD = $(LDADD)
242c1e
 fchmod_DEPENDENCIES = libtests.a
242c1e
+fchmod_y_SOURCES = fchmod-y.c
242c1e
+fchmod_y_OBJECTS = fchmod-y.$(OBJEXT)
242c1e
+fchmod_y_LDADD = $(LDADD)
242c1e
+fchmod_y_DEPENDENCIES = libtests.a
242c1e
 fchmodat_SOURCES = fchmodat.c
242c1e
 fchmodat_OBJECTS = fchmodat.$(OBJEXT)
242c1e
 fchmodat_LDADD = $(LDADD)
242c1e
@@ -4508,9 +4512,10 @@
242c1e
 	execve-v.c execveat.c execveat-v.c faccessat.c fadvise64.c \
242c1e
 	fadvise64_64.c fallocate.c fanotify_init.c fanotify_mark.c \
242c1e
 	fanotify_mark-Xabbrev.c fanotify_mark-Xraw.c \
242c1e
-	fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmodat.c fchown.c \
242c1e
-	fchown32.c fchownat.c fcntl.c fcntl--pidns-translation.c \
242c1e
-	fcntl64.c fcntl64--pidns-translation.c fdatasync.c fflush.c \
242c1e
+	fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmod-y.c \
242c1e
+	fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c \
242c1e
+	fcntl--pidns-translation.c fcntl64.c \
242c1e
+	fcntl64--pidns-translation.c fdatasync.c fflush.c \
242c1e
 	file_handle.c file_ioctl.c filter-unavailable.c \
242c1e
 	filter_seccomp-flag.c filter_seccomp-perf.c finit_module.c \
242c1e
 	flock.c fork--pidns-translation.c fork-f.c fsconfig.c \
242c1e
@@ -4755,9 +4760,10 @@
242c1e
 	execve-v.c execveat.c execveat-v.c faccessat.c fadvise64.c \
242c1e
 	fadvise64_64.c fallocate.c fanotify_init.c fanotify_mark.c \
242c1e
 	fanotify_mark-Xabbrev.c fanotify_mark-Xraw.c \
242c1e
-	fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmodat.c fchown.c \
242c1e
-	fchown32.c fchownat.c fcntl.c fcntl--pidns-translation.c \
242c1e
-	fcntl64.c fcntl64--pidns-translation.c fdatasync.c fflush.c \
242c1e
+	fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmod-y.c \
242c1e
+	fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c \
242c1e
+	fcntl--pidns-translation.c fcntl64.c \
242c1e
+	fcntl64--pidns-translation.c fdatasync.c fflush.c \
242c1e
 	file_handle.c file_ioctl.c filter-unavailable.c \
242c1e
 	filter_seccomp-flag.c filter_seccomp-perf.c finit_module.c \
242c1e
 	flock.c fork--pidns-translation.c fork-f.c fsconfig.c \
242c1e
@@ -5397,6 +5403,7 @@
242c1e
 libtests_a_SOURCES = \
242c1e
 	create_nl_socket.c \
242c1e
 	create_tmpfile.c \
242c1e
+	dirfd.c \
242c1e
 	errno2name.c \
242c1e
 	error_msg.c \
242c1e
 	fill_memory.c \
242c1e
@@ -5507,6 +5514,7 @@
242c1e
   fanotify_mark-Xverbose \
242c1e
   fchdir \
242c1e
   fchmod \
242c1e
+  fchmod-y \
242c1e
   fchmodat \
242c1e
   fchown \
242c1e
   fchown32 \
242c1e
@@ -6151,11 +6159,11 @@
242c1e
 	fanotify_init.gen.test fanotify_mark.gen.test \
242c1e
 	fanotify_mark-Xabbrev.gen.test fanotify_mark-Xraw.gen.test \
242c1e
 	fanotify_mark-Xverbose.gen.test fchdir.gen.test \
242c1e
-	fchmod.gen.test fchmodat.gen.test fchown.gen.test \
242c1e
-	fchown32.gen.test fchownat.gen.test fcntl.gen.test \
242c1e
-	fcntl--pidns-translation.gen.test fcntl64.gen.test \
242c1e
-	fcntl64--pidns-translation.gen.test fdatasync.gen.test \
242c1e
-	file_handle.gen.test file_ioctl.gen.test \
242c1e
+	fchmod.gen.test fchmod-y.gen.test fchmodat.gen.test \
242c1e
+	fchown.gen.test fchown32.gen.test fchownat.gen.test \
242c1e
+	fcntl.gen.test fcntl--pidns-translation.gen.test \
242c1e
+	fcntl64.gen.test fcntl64--pidns-translation.gen.test \
242c1e
+	fdatasync.gen.test file_handle.gen.test file_ioctl.gen.test \
242c1e
 	filter_seccomp.gen.test filter_seccomp-flag.gen.test \
242c1e
 	finit_module.gen.test flock.gen.test fork-f.gen.test \
242c1e
 	fsconfig.gen.test fsconfig-P.gen.test fsmount.gen.test \
242c1e
@@ -7242,6 +7250,10 @@
242c1e
 	@rm -f fchmod$(EXEEXT)
242c1e
 	$(AM_V_CCLD)$(LINK) $(fchmod_OBJECTS) $(fchmod_LDADD) $(LIBS)
242c1e
 
242c1e
+fchmod-y$(EXEEXT): $(fchmod_y_OBJECTS) $(fchmod_y_DEPENDENCIES) $(EXTRA_fchmod_y_DEPENDENCIES) 
242c1e
+	@rm -f fchmod-y$(EXEEXT)
242c1e
+	$(AM_V_CCLD)$(LINK) $(fchmod_y_OBJECTS) $(fchmod_y_LDADD) $(LIBS)
242c1e
+
242c1e
 fchmodat$(EXEEXT): $(fchmodat_OBJECTS) $(fchmodat_DEPENDENCIES) $(EXTRA_fchmodat_DEPENDENCIES) 
242c1e
 	@rm -f fchmodat$(EXEEXT)
242c1e
 	$(AM_V_CCLD)$(LINK) $(fchmodat_OBJECTS) $(fchmodat_LDADD) $(LIBS)
242c1e
@@ -10176,6 +10188,7 @@
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark-Xverbose.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchdir.Po@am__quote@ # am--include-marker
242c1e
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmod-y.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmod.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmodat.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown.Po@am__quote@ # am--include-marker
242c1e
@@ -10394,6 +10407,7 @@
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown32.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-create_nl_socket.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-create_tmpfile.Po@am__quote@ # am--include-marker
242c1e
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-dirfd.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-errno2name.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-error_msg.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-fill_memory.Po@am__quote@ # am--include-marker
242c1e
@@ -10975,6 +10987,20 @@
242c1e
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
242c1e
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-create_tmpfile.obj `if test -f 'create_tmpfile.c'; then $(CYGPATH_W) 'create_tmpfile.c'; else $(CYGPATH_W) '$(srcdir)/create_tmpfile.c'; fi`
242c1e
 
242c1e
+libtests_a-dirfd.o: dirfd.c
242c1e
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-dirfd.o -MD -MP -MF $(DEPDIR)/libtests_a-dirfd.Tpo -c -o libtests_a-dirfd.o `test -f 'dirfd.c' || echo '$(srcdir)/'`dirfd.c
242c1e
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-dirfd.Tpo $(DEPDIR)/libtests_a-dirfd.Po
242c1e
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='dirfd.c' object='libtests_a-dirfd.o' libtool=no @AMDEPBACKSLASH@
242c1e
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
242c1e
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-dirfd.o `test -f 'dirfd.c' || echo '$(srcdir)/'`dirfd.c
242c1e
+
242c1e
+libtests_a-dirfd.obj: dirfd.c
242c1e
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-dirfd.obj -MD -MP -MF $(DEPDIR)/libtests_a-dirfd.Tpo -c -o libtests_a-dirfd.obj `if test -f 'dirfd.c'; then $(CYGPATH_W) 'dirfd.c'; else $(CYGPATH_W) '$(srcdir)/dirfd.c'; fi`
242c1e
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-dirfd.Tpo $(DEPDIR)/libtests_a-dirfd.Po
242c1e
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='dirfd.c' object='libtests_a-dirfd.obj' libtool=no @AMDEPBACKSLASH@
242c1e
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
242c1e
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-dirfd.obj `if test -f 'dirfd.c'; then $(CYGPATH_W) 'dirfd.c'; else $(CYGPATH_W) '$(srcdir)/dirfd.c'; fi`
242c1e
+
242c1e
 libtests_a-errno2name.o: errno2name.c
242c1e
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-errno2name.o -MD -MP -MF $(DEPDIR)/libtests_a-errno2name.Tpo -c -o libtests_a-errno2name.o `test -f 'errno2name.c' || echo '$(srcdir)/'`errno2name.c
242c1e
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-errno2name.Tpo $(DEPDIR)/libtests_a-errno2name.Po
242c1e
@@ -14015,6 +14041,9 @@
242c1e
 $(srcdir)/fchmod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in
242c1e
 	$(AM_V_GEN) $^ $@
242c1e
 
242c1e
+$(srcdir)/fchmod-y.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in
242c1e
+	$(AM_V_GEN) $^ $@
242c1e
+
242c1e
 $(srcdir)/fchmodat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in
242c1e
 	$(AM_V_GEN) $^ $@
242c1e
 
242c1e
Index: strace-5.7/tests-mx32/Makefile.in
242c1e
===================================================================
242c1e
--- strace-5.7.orig/tests-mx32/Makefile.in	2021-08-24 19:31:43.662872392 +0200
242c1e
+++ strace-5.7/tests-mx32/Makefile.in	2021-08-24 19:32:04.039699924 +0200
242c1e
@@ -303,7 +303,7 @@
242c1e
 	fanotify_init$(EXEEXT) fanotify_mark$(EXEEXT) \
242c1e
 	fanotify_mark-Xabbrev$(EXEEXT) fanotify_mark-Xraw$(EXEEXT) \
242c1e
 	fanotify_mark-Xverbose$(EXEEXT) fchdir$(EXEEXT) \
242c1e
-	fchmod$(EXEEXT) fchmodat$(EXEEXT) fchown$(EXEEXT) \
242c1e
+	fchmod$(EXEEXT) fchmod-y$(EXEEXT) fchmodat$(EXEEXT) fchown$(EXEEXT) \
242c1e
 	fchown32$(EXEEXT) fchownat$(EXEEXT) fcntl$(EXEEXT) \
242c1e
 	fcntl64$(EXEEXT) fdatasync$(EXEEXT) fflush$(EXEEXT) \
242c1e
 	file_handle$(EXEEXT) file_ioctl$(EXEEXT) finit_module$(EXEEXT) \
242c1e
@@ -551,7 +551,7 @@
242c1e
 libtests_a_AR = $(AR) $(ARFLAGS)
242c1e
 libtests_a_LIBADD =
242c1e
 am_libtests_a_OBJECTS = libtests_a-create_nl_socket.$(OBJEXT) \
242c1e
-	libtests_a-create_tmpfile.$(OBJEXT) \
242c1e
+	libtests_a-create_tmpfile.$(OBJEXT) libtests_a-dirfd.$(OBJEXT) \
242c1e
 	libtests_a-errno2name.$(OBJEXT) libtests_a-error_msg.$(OBJEXT) \
242c1e
 	libtests_a-fill_memory.$(OBJEXT) \
242c1e
 	libtests_a-get_page_size.$(OBJEXT) \
242c1e
@@ -986,6 +986,10 @@
242c1e
 fchmod_OBJECTS = fchmod.$(OBJEXT)
242c1e
 fchmod_LDADD = $(LDADD)
242c1e
 fchmod_DEPENDENCIES = libtests.a
242c1e
+fchmod_y_SOURCES = fchmod-y.c
242c1e
+fchmod_y_OBJECTS = fchmod-y.$(OBJEXT)
242c1e
+fchmod_y_LDADD = $(LDADD)
242c1e
+fchmod_y_DEPENDENCIES = libtests.a
242c1e
 fchmodat_SOURCES = fchmodat.c
242c1e
 fchmodat_OBJECTS = fchmodat.$(OBJEXT)
242c1e
 fchmodat_LDADD = $(LDADD)
242c1e
@@ -4508,9 +4512,10 @@
242c1e
 	execve-v.c execveat.c execveat-v.c faccessat.c fadvise64.c \
242c1e
 	fadvise64_64.c fallocate.c fanotify_init.c fanotify_mark.c \
242c1e
 	fanotify_mark-Xabbrev.c fanotify_mark-Xraw.c \
242c1e
-	fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmodat.c fchown.c \
242c1e
-	fchown32.c fchownat.c fcntl.c fcntl--pidns-translation.c \
242c1e
-	fcntl64.c fcntl64--pidns-translation.c fdatasync.c fflush.c \
242c1e
+	fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmod-y.c \
242c1e
+	fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c \
242c1e
+	fcntl--pidns-translation.c fcntl64.c \
242c1e
+	fcntl64--pidns-translation.c fdatasync.c fflush.c \
242c1e
 	file_handle.c file_ioctl.c filter-unavailable.c \
242c1e
 	filter_seccomp-flag.c filter_seccomp-perf.c finit_module.c \
242c1e
 	flock.c fork--pidns-translation.c fork-f.c fsconfig.c \
242c1e
@@ -4755,9 +4760,10 @@
242c1e
 	execve-v.c execveat.c execveat-v.c faccessat.c fadvise64.c \
242c1e
 	fadvise64_64.c fallocate.c fanotify_init.c fanotify_mark.c \
242c1e
 	fanotify_mark-Xabbrev.c fanotify_mark-Xraw.c \
242c1e
-	fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmodat.c fchown.c \
242c1e
-	fchown32.c fchownat.c fcntl.c fcntl--pidns-translation.c \
242c1e
-	fcntl64.c fcntl64--pidns-translation.c fdatasync.c fflush.c \
242c1e
+	fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmod-y.c \
242c1e
+	fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c \
242c1e
+	fcntl--pidns-translation.c fcntl64.c \
242c1e
+	fcntl64--pidns-translation.c fdatasync.c fflush.c \
242c1e
 	file_handle.c file_ioctl.c filter-unavailable.c \
242c1e
 	filter_seccomp-flag.c filter_seccomp-perf.c finit_module.c \
242c1e
 	flock.c fork--pidns-translation.c fork-f.c fsconfig.c \
242c1e
@@ -5397,6 +5403,7 @@
242c1e
 libtests_a_SOURCES = \
242c1e
 	create_nl_socket.c \
242c1e
 	create_tmpfile.c \
242c1e
+	dirfd.c \
242c1e
 	errno2name.c \
242c1e
 	error_msg.c \
242c1e
 	fill_memory.c \
242c1e
@@ -5507,6 +5514,7 @@
242c1e
   fanotify_mark-Xverbose \
242c1e
   fchdir \
242c1e
   fchmod \
242c1e
+  fchmod-y \
242c1e
   fchmodat \
242c1e
   fchown \
242c1e
   fchown32 \
242c1e
@@ -6151,11 +6159,11 @@
242c1e
 	fanotify_init.gen.test fanotify_mark.gen.test \
242c1e
 	fanotify_mark-Xabbrev.gen.test fanotify_mark-Xraw.gen.test \
242c1e
 	fanotify_mark-Xverbose.gen.test fchdir.gen.test \
242c1e
-	fchmod.gen.test fchmodat.gen.test fchown.gen.test \
242c1e
-	fchown32.gen.test fchownat.gen.test fcntl.gen.test \
242c1e
-	fcntl--pidns-translation.gen.test fcntl64.gen.test \
242c1e
-	fcntl64--pidns-translation.gen.test fdatasync.gen.test \
242c1e
-	file_handle.gen.test file_ioctl.gen.test \
242c1e
+	fchmod.gen.test fchmod-y.gen.test fchmodat.gen.test \
242c1e
+	fchown.gen.test fchown32.gen.test fchownat.gen.test \
242c1e
+	fcntl.gen.test fcntl--pidns-translation.gen.test \
242c1e
+	fcntl64.gen.test fcntl64--pidns-translation.gen.test \
242c1e
+	fdatasync.gen.test file_handle.gen.test file_ioctl.gen.test \
242c1e
 	filter_seccomp.gen.test filter_seccomp-flag.gen.test \
242c1e
 	finit_module.gen.test flock.gen.test fork-f.gen.test \
242c1e
 	fsconfig.gen.test fsconfig-P.gen.test fsmount.gen.test \
242c1e
@@ -7242,6 +7250,10 @@
242c1e
 	@rm -f fchmod$(EXEEXT)
242c1e
 	$(AM_V_CCLD)$(LINK) $(fchmod_OBJECTS) $(fchmod_LDADD) $(LIBS)
242c1e
 
242c1e
+fchmod-y$(EXEEXT): $(fchmod_y_OBJECTS) $(fchmod_y_DEPENDENCIES) $(EXTRA_fchmod_y_DEPENDENCIES) 
242c1e
+	@rm -f fchmod-y$(EXEEXT)
242c1e
+	$(AM_V_CCLD)$(LINK) $(fchmod_y_OBJECTS) $(fchmod_y_LDADD) $(LIBS)
242c1e
+
242c1e
 fchmodat$(EXEEXT): $(fchmodat_OBJECTS) $(fchmodat_DEPENDENCIES) $(EXTRA_fchmodat_DEPENDENCIES) 
242c1e
 	@rm -f fchmodat$(EXEEXT)
242c1e
 	$(AM_V_CCLD)$(LINK) $(fchmodat_OBJECTS) $(fchmodat_LDADD) $(LIBS)
242c1e
@@ -10176,6 +10188,7 @@
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark-Xverbose.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchdir.Po@am__quote@ # am--include-marker
242c1e
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmod-y.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmod.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmodat.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown.Po@am__quote@ # am--include-marker
242c1e
@@ -10394,6 +10407,7 @@
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown32.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-create_nl_socket.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-create_tmpfile.Po@am__quote@ # am--include-marker
242c1e
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-dirfd.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-errno2name.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-error_msg.Po@am__quote@ # am--include-marker
242c1e
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-fill_memory.Po@am__quote@ # am--include-marker
242c1e
@@ -10975,6 +10987,20 @@
242c1e
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
242c1e
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-create_tmpfile.obj `if test -f 'create_tmpfile.c'; then $(CYGPATH_W) 'create_tmpfile.c'; else $(CYGPATH_W) '$(srcdir)/create_tmpfile.c'; fi`
242c1e
 
242c1e
+libtests_a-dirfd.o: dirfd.c
242c1e
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-dirfd.o -MD -MP -MF $(DEPDIR)/libtests_a-dirfd.Tpo -c -o libtests_a-dirfd.o `test -f 'dirfd.c' || echo '$(srcdir)/'`dirfd.c
242c1e
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-dirfd.Tpo $(DEPDIR)/libtests_a-dirfd.Po
242c1e
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='dirfd.c' object='libtests_a-dirfd.o' libtool=no @AMDEPBACKSLASH@
242c1e
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
242c1e
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-dirfd.o `test -f 'dirfd.c' || echo '$(srcdir)/'`dirfd.c
242c1e
+
242c1e
+libtests_a-dirfd.obj: dirfd.c
242c1e
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-dirfd.obj -MD -MP -MF $(DEPDIR)/libtests_a-dirfd.Tpo -c -o libtests_a-dirfd.obj `if test -f 'dirfd.c'; then $(CYGPATH_W) 'dirfd.c'; else $(CYGPATH_W) '$(srcdir)/dirfd.c'; fi`
242c1e
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-dirfd.Tpo $(DEPDIR)/libtests_a-dirfd.Po
242c1e
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='dirfd.c' object='libtests_a-dirfd.obj' libtool=no @AMDEPBACKSLASH@
242c1e
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
242c1e
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-dirfd.obj `if test -f 'dirfd.c'; then $(CYGPATH_W) 'dirfd.c'; else $(CYGPATH_W) '$(srcdir)/dirfd.c'; fi`
242c1e
+
242c1e
 libtests_a-errno2name.o: errno2name.c
242c1e
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-errno2name.o -MD -MP -MF $(DEPDIR)/libtests_a-errno2name.Tpo -c -o libtests_a-errno2name.o `test -f 'errno2name.c' || echo '$(srcdir)/'`errno2name.c
242c1e
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-errno2name.Tpo $(DEPDIR)/libtests_a-errno2name.Po
242c1e
@@ -14015,6 +14041,9 @@
242c1e
 $(srcdir)/fchmod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in
242c1e
 	$(AM_V_GEN) $^ $@
242c1e
 
242c1e
+$(srcdir)/fchmod-y.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in
242c1e
+	$(AM_V_GEN) $^ $@
242c1e
+
242c1e
 $(srcdir)/fchmodat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in
242c1e
 	$(AM_V_GEN) $^ $@
242c1e