diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-06-24 16:59:19 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-07-05 10:08:48 -0300 |
commit | af1aa36c617d72e80ff6b268bf927b6642d90823 (patch) | |
tree | 9da46e918d6c910ce7cada5547a571b38defd673 /sysdeps/unix/sysv/linux/sys/mount.h | |
parent | c3b02b6567e5709614eb24c85c3c0b69ae5c58a6 (diff) | |
download | glibc-af1aa36c617d72e80ff6b268bf927b6642d90823.tar glibc-af1aa36c617d72e80ff6b268bf927b6642d90823.tar.gz glibc-af1aa36c617d72e80ff6b268bf927b6642d90823.tar.bz2 glibc-af1aa36c617d72e80ff6b268bf927b6642d90823.zip |
linux: Add mount_setattr
It was added on Linux 5.12 (2a1867219c7b27f928e2545782b86daaf9ad50bd)
to allow change the properties of a mount or a mount tree using file
descriptors which the new mount api is based on.
Checked on x86_64-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux/sys/mount.h')
-rw-r--r-- | sysdeps/unix/sysv/linux/sys/mount.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h index 534d05b3f5..f965986ba8 100644 --- a/sysdeps/unix/sysv/linux/sys/mount.h +++ b/sysdeps/unix/sysv/linux/sys/mount.h @@ -23,6 +23,8 @@ #include <fcntl.h> #include <features.h> +#include <stdint.h> +#include <stddef.h> #include <sys/ioctl.h> #define BLOCK_SIZE 1024 @@ -155,6 +157,17 @@ enum #define MOUNT_ATTR_NOSYMFOLLOW 0x00200000 /* Do not follow symlinks. */ +/* For mount_setattr. */ +struct mount_attr +{ + uint64_t attr_set; + uint64_t attr_clr; + uint64_t propagation; + uint64_t userns_fd; +}; + +#define MOUNT_ATTR_SIZE_VER0 32 /* sizeof first published struct */ + /* move_mount flags. */ #define MOVE_MOUNT_F_SYMLINKS 0x00000001 /* Follow symlinks on from path */ #define MOVE_MOUNT_F_AUTOMOUNTS 0x00000002 /* Follow automounts on from path */ @@ -240,6 +253,15 @@ extern int fspick (int __dfd, const char *__path, unsigned int __flags) extern int open_tree (int __dfd, const char *__filename, unsigned int __flags) __THROW; +/* Change the mount properties of the mount or an entire mount tree. If + PATH is a relative pathname, then it is interpreted relative to the + directory referred to by the file descriptor dirfd. Otherwise if DFD is + the special value AT_FDCWD then PATH is interpreted relative to the current + working directory of the calling process. */ +extern int mount_setattr (int __dfd, const char *__path, unsigned int __flags, + struct mount_attr *__uattr, size_t __usize) + __THROW; + __END_DECLS #endif /* _SYS_MOUNT_H */ |