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-3-luis@igalia.com>
Date: Fri, 29 May 2026 18:10:59 +0100
From: Luis Henriques <luis@...lia.com>
To: musl@...ts.openwall.com
Cc: Luis Henriques <luis@...lia.com>
Subject: [RFC PATCH 2/6] add move_mount() linux syscall wrapper

The move_mount() 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 | 10 ++++++++++
 src/linux/mount.c   |  5 +++++
 2 files changed, 15 insertions(+)

diff --git a/include/sys/mount.h b/include/sys/mount.h
index c77a81c1b552..ec7027a3c967 100644
--- a/include/sys/mount.h
+++ b/include/sys/mount.h
@@ -67,11 +67,21 @@ extern "C" {
 #define OPEN_TREE_CLONE         1
 #define OPEN_TREE_CLOEXEC       O_CLOEXEC
 
+#define MOVE_MOUNT_F_SYMLINKS   0x00000001
+#define MOVE_MOUNT_F_AUTOMOUNTS 0x00000002
+#define MOVE_MOUNT_F_EMPTY_PATH 0x00000004
+#define MOVE_MOUNT_T_SYMLINKS   0x00000010
+#define MOVE_MOUNT_T_AUTOMOUNTS 0x00000020
+#define MOVE_MOUNT_T_EMPTY_PATH 0x00000040
+#define MOVE_MOUNT_SET_GROUP    0x00000100
+#define MOVE_MOUNT_BENEATH      0x00000200
+
 int mount(const char *, const char *, const char *, unsigned long, const void *);
 int umount(const char *);
 int umount2(const char *, int);
 
 int open_tree(int, const char *, unsigned int);
+int move_mount(int, const char *, int, const char *, unsigned int);
 
 #ifdef __cplusplus
 }
diff --git a/src/linux/mount.c b/src/linux/mount.c
index 080ec9e1222b..b91d9e8c8d22 100644
--- a/src/linux/mount.c
+++ b/src/linux/mount.c
@@ -20,3 +20,8 @@ int open_tree(int dirfd, const char *path, unsigned int flags)
 {
 	return syscall(SYS_open_tree, dirfd, path, flags);
 }
+
+int move_mount(int from_dirfd, const char *from_path, int to_dirfd, const char *to_path, unsigned int flags)
+{
+	return syscall(SYS_move_mount, from_dirfd, from_path, to_dirfd, to_path, 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.