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

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

diff --git a/include/sys/mount.h b/include/sys/mount.h
index 09bd6e9dfeff..c77a81c1b552 100644
--- a/include/sys/mount.h
+++ b/include/sys/mount.h
@@ -64,10 +64,15 @@ extern "C" {
 #define MNT_EXPIRE      4
 #define UMOUNT_NOFOLLOW 8
 
+#define OPEN_TREE_CLONE         1
+#define OPEN_TREE_CLOEXEC       O_CLOEXEC
+
 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);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/linux/mount.c b/src/linux/mount.c
index 34e11af12035..080ec9e1222b 100644
--- a/src/linux/mount.c
+++ b/src/linux/mount.c
@@ -15,3 +15,8 @@ int umount2(const char *special, int flags)
 {
 	return syscall(SYS_umount2, special, flags);
 }
+
+int open_tree(int dirfd, const char *path, unsigned int flags)
+{
+	return syscall(SYS_open_tree, dirfd, 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.