#ifndef _SYS_MOUNT_H
#define _SYS_MOUNT_H 1
#include <features.h>
#include <stdint.h>
#include <stddef.h>
#include <sys/ioctl.h>
#ifdef __has_include
# if __has_include ("linux/mount.h")
# include "linux/mount.h"
# endif
#endif
#define BLOCK_SIZE_BITS 10
#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
enum
{
#undef MS_RDONLY
MS_RDONLY = 1,
#define MS_RDONLY MS_RDONLY
#undef MS_NOSUID
MS_NOSUID = 2,
#define MS_NOSUID MS_NOSUID
#undef MS_NODEV
MS_NODEV = 4,
#define MS_NODEV MS_NODEV
#undef MS_NOEXEC
MS_NOEXEC = 8,
#define MS_NOEXEC MS_NOEXEC
#undef MS_SYNCHRONOUS
MS_SYNCHRONOUS = 16,
#define MS_SYNCHRONOUS MS_SYNCHRONOUS
#undef MS_REMOUNT
MS_REMOUNT = 32,
#define MS_REMOUNT MS_REMOUNT
#undef MS_MANDLOCK
MS_MANDLOCK = 64,
#define MS_MANDLOCK MS_MANDLOCK
#undef MS_DIRSYNC
MS_DIRSYNC = 128,
#define MS_DIRSYNC MS_DIRSYNC
#undef MS_NOSYMFOLLOW
MS_NOSYMFOLLOW = 256,
#define MS_NOSYMFOLLOW MS_NOSYMFOLLOW
#undef MS_NOATIME
MS_NOATIME = 1024,
#define MS_NOATIME MS_NOATIME
#undef MS_NODIRATIME
MS_NODIRATIME = 2048,
#define MS_NODIRATIME MS_NODIRATIME
#undef MS_BIND
MS_BIND = 4096,
#define MS_BIND MS_BIND
#undef MS_MOVE
MS_MOVE = 8192,
#define MS_MOVE MS_MOVE
#undef MS_REC
MS_REC = 16384,
#define MS_REC MS_REC
#undef MS_SILENT
MS_SILENT = 32768,
#define MS_SILENT MS_SILENT
#undef MS_POSIXACL
MS_POSIXACL = 1 << 16,
#define MS_POSIXACL MS_POSIXACL
#undef MS_UNBINDABLE
MS_UNBINDABLE = 1 << 17,
#define MS_UNBINDABLE MS_UNBINDABLE
#undef MS_PRIVATE
MS_PRIVATE = 1 << 18,
#define MS_PRIVATE MS_PRIVATE
#undef MS_SLAVE
MS_SLAVE = 1 << 19,
#define MS_SLAVE MS_SLAVE
#undef MS_SHARED
MS_SHARED = 1 << 20,
#define MS_SHARED MS_SHARED
#undef MS_RELATIME
MS_RELATIME = 1 << 21,
#define MS_RELATIME MS_RELATIME
#undef MS_KERNMOUNT
MS_KERNMOUNT = 1 << 22,
#define MS_KERNMOUNT MS_KERNMOUNT
#undef MS_I_VERSION
MS_I_VERSION = 1 << 23,
#define MS_I_VERSION MS_I_VERSION
#undef MS_STRICTATIME
MS_STRICTATIME = 1 << 24,
#define MS_STRICTATIME MS_STRICTATIME
#undef MS_LAZYTIME
MS_LAZYTIME = 1 << 25,
#define MS_LAZYTIME MS_LAZYTIME
#undef MS_ACTIVE
MS_ACTIVE = 1 << 30,
#define MS_ACTIVE MS_ACTIVE
#undef MS_NOUSER
MS_NOUSER = 1 << 31
#define MS_NOUSER MS_NOUSER
};
#undef MS_RMT_MASK
#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION \
|MS_LAZYTIME)
#undef MS_MGC_VAL
#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number to indicate "new" flags */
#define MS_MGC_MSK 0xffff0000 /* Magic flag number mask */
#undef BLKROSET
#define BLKROSET _IO(0x12, 93) /* Set device read-only (0 = read-write). */
#undef BLKROGET
#define BLKROGET _IO(0x12, 94) /* Get read-only status (0 = read_write). */
#undef BLKRRPART
#define BLKRRPART _IO(0x12, 95) /* Re-read partition table. */
#undef BLKGETSIZE
#define BLKGETSIZE _IO(0x12, 96) /* Return device size. */
#undef BLKFLSBUF
#define BLKFLSBUF _IO(0x12, 97) /* Flush buffer cache. */
#undef BLKRASET
#define BLKRASET _IO(0x12, 98) /* Set read ahead for block device. */
#undef BLKRAGET
#define BLKRAGET _IO(0x12, 99) /* Get current read ahead setting. */
#undef BLKFRASET
#define BLKFRASET _IO(0x12,100) /* Set filesystem read-ahead. */
#undef BLKFRAGET
#define BLKFRAGET _IO(0x12,101) /* Get filesystem read-ahead. */
#undef BLKSECTSET
#define BLKSECTSET _IO(0x12,102) /* Set max sectors per request. */
#undef BLKSECTGET
#define BLKSECTGET _IO(0x12,103) /* Get max sectors per request. */
#undef BLKSSZGET
#define BLKSSZGET _IO(0x12,104) /* Get block device sector size. */
#undef BLKBSZGET
#define BLKBSZGET _IOR(0x12,112,size_t)
#undef BLKBSZSET
#define BLKBSZSET _IOW(0x12,113,size_t)
#undef BLKGETSIZE64
#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size. */
enum
{
MNT_FORCE = 1,
#define MNT_FORCE MNT_FORCE
MNT_DETACH = 2,
#define MNT_DETACH MNT_DETACH
MNT_EXPIRE = 4,
#define MNT_EXPIRE MNT_EXPIRE
UMOUNT_NOFOLLOW = 8
#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
};
#define FSMOUNT_CLOEXEC 0x00000001
#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. */
#ifndef MOUNT_ATTR_SIZE_VER0
struct mount_attr
{
uint64_t attr_set;
uint64_t attr_clr;
uint64_t propagation;
uint64_t userns_fd;
};
#endif
#define MOUNT_ATTR_SIZE_VER0 32 /* sizeof first published struct */
#define MOVE_MOUNT_F_SYMLINKS 0x00000001 /* Follow symlinks on from path */
#define MOVE_MOUNT_F_AUTOMOUNTS 0x00000002 /* Follow automounts on from path */
#define MOVE_MOUNT_F_EMPTY_PATH 0x00000004 /* Empty from path permitted */
#define MOVE_MOUNT_T_SYMLINKS 0x00000010 /* Follow symlinks on to path */
#define MOVE_MOUNT_T_AUTOMOUNTS 0x00000020 /* Follow automounts on to path */
#define MOVE_MOUNT_T_EMPTY_PATH 0x00000040 /* Empty to path permitted */
#define MOVE_MOUNT_SET_GROUP 0x00000100 /* Set sharing group instead */
#define MOVE_MOUNT_BENEATH 0x00000200 /* Mount beneath top mount */
#define FSPICK_CLOEXEC 0x00000001
#define FSPICK_SYMLINK_NOFOLLOW 0x00000002
#define FSPICK_NO_AUTOMOUNT 0x00000004
#define FSPICK_EMPTY_PATH 0x00000008
#ifndef FSOPEN_CLOEXEC
enum fsconfig_command
{
FSCONFIG_SET_FLAG = 0,
# define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG
FSCONFIG_SET_STRING = 1,
# define FSCONFIG_SET_STRING FSCONFIG_SET_STRING
FSCONFIG_SET_BINARY = 2,
# define FSCONFIG_SET_BINARY FSCONFIG_SET_BINARY
FSCONFIG_SET_PATH = 3,
# define FSCONFIG_SET_PATH FSCONFIG_SET_PATH
FSCONFIG_SET_PATH_EMPTY = 4,
# define FSCONFIG_SET_PATH_EMPTY FSCONFIG_SET_PATH_EMPTY
FSCONFIG_SET_FD = 5,
# define FSCONFIG_SET_FD FSCONFIG_SET_FD
FSCONFIG_CMD_CREATE = 6,
# define FSCONFIG_CMD_CREATE FSCONFIG_CMD_CREATE
FSCONFIG_CMD_RECONFIGURE = 7,
# define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE
FSCONFIG_CMD_CREATE_EXCL = 8,
# define FSCONFIG_CMD_CREATE_EXCL FSCONFIG_CMD_CREATE_EXCL
};
#endif
#define FSOPEN_CLOEXEC 0x00000001
#ifndef OPEN_TREE_CLONE
# define OPEN_TREE_CLONE 1 /* Clone the target tree and attach the clone */
#endif
#ifndef O_CLOEXEC
# include <bits/cloexec.h>
# define O_CLOEXEC __O_CLOEXEC
#endif
#ifndef OPEN_TREE_CLOEXEC
# define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */
#endif
__BEGIN_DECLS
extern int mount (const char *__special_file, const char *__dir,
const char *__fstype, unsigned long int __rwflag,
const void *__data) __THROW;
extern int umount (const char *__special_file) __THROW;
extern int umount2 (const char *__special_file, int __flags) __THROW;
extern int fsopen (const char *__fs_name, unsigned int __flags) __THROW;
extern int fsmount (int __fd, unsigned int __flags,
unsigned int __ms_flags) __THROW;
extern int move_mount (int __from_dfd, const char *__from_pathname,
int __to_dfd, const char *__to_pathname,
unsigned int flags) __THROW;
extern int fsconfig (int __fd, unsigned int __cmd, const char *__key,
const void *__value, int __aux) __THROW;
extern int fspick (int __dfd, const char *__path, unsigned int __flags)
__THROW;
extern int open_tree (int __dfd, const char *__filename, unsigned int __flags)
__THROW;
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 */