From: Frank Chang <frank.chang@sifive.com>
openat2.h was introduced in Linux kernel 5.6. However, RESOLVE_CACHED
flag was only added in kernel 5.12 and later. Therefore, we need to check
if RESOLVE_CACHED flag is defined before using it.
Signed-off-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Helge Deller <deller@gmx.de>
Signed-off-by: Helge Deller <deller@gmx.de>
---
linux-user/strace.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/linux-user/strace.c b/linux-user/strace.c
index d253b522bf..02d610a7f8 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -1129,7 +1129,9 @@ UNUSED static const struct flags openat2_resolve_flags[] = {
FLAG_GENERIC(RESOLVE_NO_SYMLINKS),
FLAG_GENERIC(RESOLVE_BENEATH),
FLAG_GENERIC(RESOLVE_IN_ROOT),
+#ifdef RESOLVE_CACHED
FLAG_GENERIC(RESOLVE_CACHED),
+#endif
#endif
FLAG_END,
};
--
2.53.0