From b4deb7beb8c977f79642a6a839c0475e1ce3a209 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 31 Jan 2022 09:46:24 -0300 Subject: linux: Add fsmount It was added on 5.2 (93766fbd2696c2c4453dd8e1070977e9cd4e6b6d) to provide a way by which a filesystem opened with fsopen and configured by a series of fsconfig calls can have a detached mount object created for it. Tested-by: Carlos O'Donell Reviewed-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/sys/mount.h | 21 +++++++++++++++++++++ 1 file changed, 21 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 56da283d3f..6d55c55de8 100644 --- a/sysdeps/unix/sysv/linux/sys/mount.h +++ b/sysdeps/unix/sysv/linux/sys/mount.h @@ -137,6 +137,22 @@ enum /* fsopen flags. */ #define FSOPEN_CLOEXEC 0x00000001 +/* fsmount flags. */ +#define FSMOUNT_CLOEXEC 0x00000001 + +/* mount attributes used on fsmount. */ +#define MOUNT_ATTR_RDONLY 0x00000001 /* Mount read-only. */ +#define MOUNT_ATTR_NOSUID 0x00000002 /* Ignore suid and sgid bits. */ +#define MOUNT_ATTR_NODEV 0x00000004 /* Disallow access to device special files. */ +#define MOUNT_ATTR_NOEXEC 0x00000008 /* Disallow program execution. */ +#define MOUNT_ATTR__ATIME 0x00000070 /* Setting on how atime should be updated. */ +#define MOUNT_ATTR_RELATIME 0x00000000 /* - Update atime relative to mtime/ctime. */ +#define MOUNT_ATTR_NOATIME 0x00000010 /* - Do not update access times. */ +#define MOUNT_ATTR_STRICTATIME 0x00000020 /* - Always perform atime updates */ +#define MOUNT_ATTR_NODIRATIME 0x00000080 /* Do not update directory access times. */ +#define MOUNT_ATTR_IDMAP 0x00100000 /* Idmap mount to @userns_fd in struct mount_attr. */ +#define MOUNT_ATTR_NOSYMFOLLOW 0x00200000 /* Do not follow symlinks. */ + __BEGIN_DECLS @@ -155,6 +171,11 @@ extern int umount2 (const char *__special_file, int __flags) __THROW; mouting. */ extern int fsopen (const char *__fs_name, unsigned int __flags) __THROW; +/* Create a mount representation for the FD created by fsopen using + FLAGS with ATTR_FLAGS describing how the mount is to be performed. */ +extern int fsmount (int __fd, unsigned int __flags, + unsigned int __ms_flags) __THROW; + __END_DECLS #endif /* _SYS_MOUNT_H */ -- cgit 1.4.1