@@ -209,6 +209,7 @@ typedata = {
'ssize_t': { 'format': '%ld', 'value': '(long) rc' },
'struct group *': { 'format': '%p', 'value': '(void *) rc' },
'struct passwd *': { 'format': '%p', 'value': '(void *) rc' },
+ 'struct open_how *': { 'format': '%p', 'value': '(void *) rc' },
'uid_t': { 'format': '%ld', 'value': ' (long) rc' },
'void *': { 'format': '%p', 'value': 'rc' },
'void': { 'format': 'void%s', 'value': '""' },
new file mode 100644
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2026 Mark Hatle <mark.hatle@amd.com>; see
+ * guts/COPYRIGHT for information.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * int openat2(int dirfd, const char *path, struct open_how *how, size_t size)
+ * int rc = -1;
+ */
+
+ (void) dirfd;
+ (void) path;
+ (void) how;
+ (void) size;
+ /* for now, let's try just failing out hard, and hope things retry with a
+ * different syscall.
+ */
+ errno = ENOSYS;
+ rc = -1;
+
+/* return rc;
+ * }
+ */
new file mode 100644
@@ -0,0 +1,13 @@
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ */
+#if __has_include (<linux/openat2.h>)
+# include <linux/openat2.h>
+#else
+ struct open_how {
+ __u64 flags;
+ __u64 mode;
+ __u64 resolve;
+ };
+#endif
new file mode 100644
@@ -0,0 +1 @@
+int openat2(int dirfd, const char *path, struct open_how *how, size_t size);
@@ -70,3 +70,5 @@ else
fi
rm -f dummy.c dummy.o
+# For openat2, similar to statx, we need to be able to build on systems without that support.
+echo "linux/openat2"