From: Mark Hatle <mark.hatle@kernel.crashing.org>
To: yocto-patches@lists.yoctoproject.org
Subject: [pseudo][pseudo-1.9]PATCH 03/10] ports/linux: Don't require <linux/mount.h>
Date: Wed, 11 Nov 2026 10:15:05 -0600 [thread overview]
Message-ID: <1794413712-18072-4-git-send-email-mark.hatle@kernel.crashing.org> (raw)
In-Reply-To: <1794413712-18072-1-git-send-email-mark.hatle@kernel.crashing.org>
From: Mark Hatle <mark.hatle@amd.com>
<linux/mount.h> only exists in kernel headers from 5.2, so pseudo no
longer built on older hosts such as CentOS 7. pseudo only needs
OPEN_TREE_CLONE, which already has a fallback, and struct mount_attr,
which is only used through pointers, so declare it instead of including
the header. The forward declaration is also needed without the header,
or each prototype using the struct declares a different type.
AI-Generated: Uses GitHub Copilot
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
(cherry picked from commit e545758f96dbe8a70623957009fd79502e638cd1)
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
---
ports/linux/portdefs.h | 7 +++++--
test/test-open_tree_attr-syscall.c | 1 -
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/ports/linux/portdefs.h b/ports/linux/portdefs.h
index ac1d971..546c33b 100644
--- a/ports/linux/portdefs.h
+++ b/ports/linux/portdefs.h
@@ -35,7 +35,6 @@ GLIBC_COMPAT_SYMBOL(memcpy,2.0);
#include <sys/prctl.h>
#include <linux/seccomp.h>
#include <sys/mount.h>
-#include <linux/mount.h>
/* close_range()'s flags, and unshare(), are only declared by glibc under
* _GNU_SOURCE, which pseudo does not build with. <linux/close_range.h> is
@@ -94,11 +93,15 @@ extern int unshare(int flags);
#define SYS_open_tree __NR_open_tree
#endif
-/* OPEN_TREE_CLONE may be missing from older host headers.
+/* The new mount API is only in <sys/mount.h> from glibc 2.36, and
+ * <linux/mount.h> is missing from older kernel headers (before 5.2), so
+ * don't rely on either. OPEN_TREE_CLONE is kernel ABI, and struct
+ * mount_attr is only used through pointers, so it can stay incomplete.
*/
#ifndef OPEN_TREE_CLONE
#define OPEN_TREE_CLONE (1U << 0)
#endif
+struct mount_attr;
#ifndef SYS_open_tree_attr
diff --git a/test/test-open_tree_attr-syscall.c b/test/test-open_tree_attr-syscall.c
index e4e652e..aead9d4 100644
--- a/test/test-open_tree_attr-syscall.c
+++ b/test/test-open_tree_attr-syscall.c
@@ -5,7 +5,6 @@
#include <stdio.h>
#include <unistd.h>
#include <sys/syscall.h>
-#include <linux/mount.h>
#include <sys/stat.h>
#ifndef SYS_open_tree_attr
--
1.8.3.1
next prev parent reply other threads:[~2026-11-11 16:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 16:15 [pseudo][pseudo-1.9]PATCH 00/10] Backports from master to 1.9 branch Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 01/10] test: Skip open_tree tests when the function or syscall is unavailable Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 02/10] makewrappers: Don't generate unused _int paths with noignore_path Mark Hatle
2026-11-11 16:15 ` Mark Hatle [this message]
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 04/10] configure: Require GCC 5 or later Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 05/10] pseudo_client: serialize path changes across clients Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 06/10] ports: hold the path lock in create and metadata wrappers Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 07/10] ports: check created files under the path lock before recording them Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 08/10] test-parallel-ops: Add a parallel create/rename/link/chmod test Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 09/10] README.security: Add information specific to file/process security Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 10/10] AGENTS.md: Add to assist future developers Mark Hatle
2026-11-12 11:46 ` [yocto-patches] [pseudo][pseudo-1.9]PATCH 00/10] Backports from master to 1.9 branch Yoann Congal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1794413712-18072-4-git-send-email-mark.hatle@kernel.crashing.org \
--to=mark.hatle@kernel.crashing.org \
--cc=yocto-patches@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.