From 78a408ee7ba041fc8d5dbd5f67065b4a982c11e5 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Fri, 24 Jun 2022 16:59:17 -0300 Subject: linux: Add open_tree It was added on Linux 5.2 (a07b20004793d8926f78d63eb5980559f7813404) to return a O_PATH-opened file descriptor to an existing mountpoint. Reviewed-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/sys/mount.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sysdeps/unix/sysv/linux/sys') diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h index e0880f75a5..534d05b3f5 100644 --- a/sysdeps/unix/sysv/linux/sys/mount.h +++ b/sysdeps/unix/sysv/linux/sys/mount.h @@ -21,6 +21,7 @@ #ifndef _SYS_MOUNT_H #define _SYS_MOUNT_H 1 +#include #include #include @@ -192,6 +193,10 @@ enum fsconfig_command #define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE }; +/* open_tree flags. */ +#define OPEN_TREE_CLONE 1 /* Clone the target tree and attach the clone */ +#define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */ + __BEGIN_DECLS @@ -231,6 +236,10 @@ extern int fsconfig (int __fd, unsigned int __cmd, const char *__key, extern int fspick (int __dfd, const char *__path, unsigned int __flags) __THROW; +/* Open the mount point FILENAME in directory DFD using FLAGS. */ +extern int open_tree (int __dfd, const char *__filename, unsigned int __flags) + __THROW; + __END_DECLS #endif /* _SYS_MOUNT_H */ -- cgit v1.2.3-70-g09d2