Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260529171103.12343-6-luis@igalia.com>
Date: Fri, 29 May 2026 18:11:02 +0100
From: Luis Henriques <luis@...lia.com>
To: musl@...ts.openwall.com
Cc: Luis Henriques <luis@...lia.com>
Subject: [RFC PATCH 5/6] add fsmount() linux syscall wrapper

The fsmount() syscall is part of the "new" mount API which was merged into
the linux kernel 5.2.

Signed-off-by: Luis Henriques <luis@...lia.com>
---
 include/sys/mount.h | 15 +++++++++++++++
 src/linux/mount.c   |  5 +++++
 2 files changed, 20 insertions(+)

diff --git a/include/sys/mount.h b/include/sys/mount.h
index 3a7dee0e04ad..06efcff4a66b 100644
--- a/include/sys/mount.h
+++ b/include/sys/mount.h
@@ -90,6 +90,20 @@ enum fsconfig_command {
 	FSCONFIG_CMD_CREATE_EXCL = 8,
 };
 
+#define FSMOUNT_CLOEXEC         0x00000001
+
+#define MOUNT_ATTR_RDONLY       0x00000001
+#define MOUNT_ATTR_NOSUID       0x00000002
+#define MOUNT_ATTR_NODEV        0x00000004
+#define MOUNT_ATTR_NOEXEC       0x00000008
+#define MOUNT_ATTR__ATIME       0x00000070
+#define MOUNT_ATTR_RELATIME     0x00000000
+#define MOUNT_ATTR_NOATIME      0x00000010
+#define MOUNT_ATTR_STRICTATIME  0x00000020
+#define MOUNT_ATTR_NODIRATIME   0x00000080
+#define MOUNT_ATTR_IDMAP        0x00100000
+#define MOUNT_ATTR_NOSYMFOLLOW  0x00200000
+
 int mount(const char *, const char *, const char *, unsigned long, const void *);
 int umount(const char *);
 int umount2(const char *, int);
@@ -98,6 +112,7 @@ int open_tree(int, const char *, unsigned int);
 int move_mount(int, const char *, int, const char *, unsigned int);
 int fsopen(const char *, unsigned int);
 int fsconfig(int, unsigned int, const char *, const void *, int);
+int fsmount(int, unsigned int, unsigned int);
 
 #ifdef __cplusplus
 }
diff --git a/src/linux/mount.c b/src/linux/mount.c
index 5be2c8cb8c58..91ea4bb6be37 100644
--- a/src/linux/mount.c
+++ b/src/linux/mount.c
@@ -35,3 +35,8 @@ int fsconfig(int fd, unsigned int cmd, const char *key, const void * value, int
 {
 	return syscall(SYS_fsconfig, fd, cmd, key, value, aux);
 }
+
+int fsmount(int fsfd, unsigned int flags, unsigned int attr_flags)
+{
+	return syscall(SYS_fsmount, fsfd, flags, attr_flags);
+}

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.