Description: Fix redefinition of 'struct open_how' in the test suite
 glibc 2.43 includes <linux/openat2.h> indirectly through
 <sys/mount.h> -> <fcntl.h>, so the fallback definition of
 'struct open_how' in src/test/util.h conflicts with the definition from
 the kernel headers, breaking the build of the test programs with:
 .
   src/test/util.h:434:8: error: redefinition of 'struct open_how'
 .
 Provide the fallback definitions only when <linux/openat2.h> has not
 already been included, using its include guard.
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Origin: vendor
Forwarded: not-needed
Last-Update: 2026-09-14

--- rr-5.9.0.orig/src/test/util.h
+++ rr-5.9.0/src/test/util.h
@@ -430,13 +430,17 @@ inline static SyscallWrapper get_spuriou
 #define RR_KCMP_FILE 0
 #define RR_KCMP_FILES 2
 
-/* Old systems don't have linux/openat2.h */
+/* Old systems don't have linux/openat2.h. Newer C libraries pull that header
+ * in through <sys/mount.h> -> <fcntl.h>, so only provide the fallback
+ * definitions below when the kernel header has not been included. */
+#ifndef _LINUX_OPENAT2_H
 struct open_how {
 	__u64 flags;
 	__u64 mode;
 	__u64 resolve;
 };
 #define RESOLVE_BENEATH	0x08
+#endif
 
 /* Old systems don't have these */
 #ifndef TIOCGPKT
