use super::super::c;
use bitflags::bitflags;
bitflags! {
pub struct Access: c::c_int {
const READ_OK = c::R_OK;
const WRITE_OK = c::W_OK;
const EXEC_OK = c::X_OK;
const EXISTS = c::F_OK;
}
}
#[cfg(not(target_os = "redox"))]
bitflags! {
pub struct AtFlags: c::c_int {
const REMOVEDIR = c::AT_REMOVEDIR;
const SYMLINK_FOLLOW = c::AT_SYMLINK_FOLLOW;
const SYMLINK_NOFOLLOW = c::AT_SYMLINK_NOFOLLOW;
#[cfg(any(
target_os = "android",
target_os = "fuchsia",
target_os = "linux",
))]
const EMPTY_PATH = c::AT_EMPTY_PATH;
#[cfg(not(any(target_os = "emscripten", target_os = "android")))]
const EACCESS = c::AT_EACCESS;
#[cfg(all(target_os = "linux", target_env = "gnu"))]
const STATX_SYNC_AS_STAT = c::AT_STATX_SYNC_AS_STAT;
#[cfg(all(target_os = "linux", target_env = "gnu"))]
const STATX_FORCE_SYNC = c::AT_STATX_FORCE_SYNC;
#[cfg(all(target_os = "linux", target_env = "gnu"))]
const STATX_DONT_SYNC = c::AT_STATX_DONT_SYNC;
}
}
bitflags! {
pub struct Mode: RawMode {
#[cfg(not(target_os = "wasi"))] const RWXU = c::S_IRWXU as RawMode;
#[cfg(not(target_os = "wasi"))] const RUSR = c::S_IRUSR as RawMode;
#[cfg(not(target_os = "wasi"))] const WUSR = c::S_IWUSR as RawMode;
#[cfg(not(target_os = "wasi"))] const XUSR = c::S_IXUSR as RawMode;
#[cfg(not(target_os = "wasi"))] const RWXG = c::S_IRWXG as RawMode;
#[cfg(not(target_os = "wasi"))] const RGRP = c::S_IRGRP as RawMode;
#[cfg(not(target_os = "wasi"))] const WGRP = c::S_IWGRP as RawMode;
#[cfg(not(target_os = "wasi"))] const XGRP = c::S_IXGRP as RawMode;
#[cfg(not(target_os = "wasi"))] const RWXO = c::S_IRWXO as RawMode;
#[cfg(not(target_os = "wasi"))] const ROTH = c::S_IROTH as RawMode;
#[cfg(not(target_os = "wasi"))] const WOTH = c::S_IWOTH as RawMode;
#[cfg(not(target_os = "wasi"))] const XOTH = c::S_IXOTH as RawMode;
#[cfg(not(target_os = "wasi"))] const SUID = c::S_ISUID as RawMode;
#[cfg(not(target_os = "wasi"))] const SGID = c::S_ISGID as RawMode;
#[cfg(not(target_os = "wasi"))] const SVTX = c::S_ISVTX as RawMode;
}
}
impl Mode {
#[inline]
pub const fn from_raw_mode(st_mode: RawMode) -> Self {
Self::from_bits_truncate(st_mode)
}
#[inline]
pub const fn as_raw_mode(self) -> RawMode {
self.bits()
}
}
bitflags! {
pub struct OFlags: c::c_int {
const ACCMODE = c::O_ACCMODE;
const RWMODE = c::O_RDONLY | c::O_WRONLY | c::O_RDWR;
const APPEND = c::O_APPEND;
#[doc(alias = "CREAT")]
const CREATE = c::O_CREAT;
const DIRECTORY = c::O_DIRECTORY;
#[cfg(not(any(target_os = "dragonfly", target_os = "freebsd", target_os = "redox")))]
const DSYNC = c::O_DSYNC;
const EXCL = c::O_EXCL;
#[cfg(any(
target_os = "dragonfly",
target_os = "freebsd",
target_os = "ios",
all(target_os = "linux", not(target_env = "musl")),
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
))]
const FSYNC = c::O_FSYNC;
const NOFOLLOW = c::O_NOFOLLOW;
const NONBLOCK = c::O_NONBLOCK;
const RDONLY = c::O_RDONLY;
const WRONLY = c::O_WRONLY;
const RDWR = c::O_RDWR;
#[cfg(not(target_os = "redox"))]
const NOCTTY = c::O_NOCTTY;
#[cfg(any(
target_os = "android",
target_os = "emscripten",
target_os = "linux",
target_os = "netbsd",
target_os = "openbsd",
target_os = "wasi",
))]
const RSYNC = c::O_RSYNC;
#[cfg(not(target_os = "redox"))]
const SYNC = c::O_SYNC;
const TRUNC = c::O_TRUNC;
#[cfg(any(
target_os = "android",
target_os = "emscripten",
target_os = "fuchsia",
target_os = "linux",
target_os = "redox",
))]
const PATH = c::O_PATH;
const CLOEXEC = c::O_CLOEXEC;
#[cfg(any(
target_os = "android",
target_os = "emscripten",
target_os = "fuchsia",
target_os = "linux",
))]
const TMPFILE = c::O_TMPFILE;
#[cfg(any(
target_os = "android",
target_os = "fuchsia",
target_os = "linux",
))]
const NOATIME = c::O_NOATIME;
}
}
#[cfg(any(target_os = "ios", target_os = "macos"))]
bitflags! {
pub struct CloneFlags: c::c_int {
const NOFOLLOW = 1;
const NOOWNERCOPY = 2;
}
}
#[cfg(any(target_os = "ios", target_os = "macos"))]
mod copyfile {
pub(super) const ACL: u32 = 1 << 0;
pub(super) const STAT: u32 = 1 << 1;
pub(super) const XATTR: u32 = 1 << 2;
pub(super) const DATA: u32 = 1 << 3;
pub(super) const SECURITY: u32 = STAT | ACL;
pub(super) const METADATA: u32 = SECURITY | XATTR;
pub(super) const ALL: u32 = METADATA | DATA;
}
#[cfg(any(target_os = "ios", target_os = "macos"))]
bitflags! {
pub struct CopyfileFlags: c::c_uint {
const ACL = copyfile::ACL;
const STAT = copyfile::STAT;
const XATTR = copyfile::XATTR;
const DATA = copyfile::DATA;
const SECURITY = copyfile::SECURITY;
const METADATA = copyfile::METADATA;
const ALL = copyfile::ALL;
}
}
#[cfg(any(target_os = "android", target_os = "linux"))]
bitflags! {
#[derive(Default)]
pub struct ResolveFlags: u64 {
const NO_XDEV = 0x01;
const NO_MAGICLINKS = 0x02;
const NO_SYMLINKS = 0x04;
const BENEATH = 0x08;
const IN_ROOT = 0x10;
const CACHED = 0x20;
}
}
#[cfg(any(target_os = "android", target_os = "linux"))]
bitflags! {
pub struct RenameFlags: c::c_uint {
const EXCHANGE = c::RENAME_EXCHANGE as _;
const NOREPLACE = c::RENAME_NOREPLACE as _;
const WHITEOUT = c::RENAME_WHITEOUT as _;
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FileType {
RegularFile = c::S_IFREG as isize,
Directory = c::S_IFDIR as isize,
Symlink = c::S_IFLNK as isize,
#[cfg(not(target_os = "wasi"))] #[doc(alias = "IFO")]
Fifo = c::S_IFIFO as isize,
#[cfg(not(target_os = "wasi"))] Socket = c::S_IFSOCK as isize,
CharacterDevice = c::S_IFCHR as isize,
BlockDevice = c::S_IFBLK as isize,
Unknown,
}
impl FileType {
pub const fn from_raw_mode(st_mode: RawMode) -> Self {
match (st_mode as c::mode_t) & c::S_IFMT {
c::S_IFREG => Self::RegularFile,
c::S_IFDIR => Self::Directory,
c::S_IFLNK => Self::Symlink,
#[cfg(not(target_os = "wasi"))] c::S_IFIFO => Self::Fifo,
#[cfg(not(target_os = "wasi"))] c::S_IFSOCK => Self::Socket,
c::S_IFCHR => Self::CharacterDevice,
c::S_IFBLK => Self::BlockDevice,
_ => Self::Unknown,
}
}
pub const fn as_raw_mode(self) -> RawMode {
match self {
Self::RegularFile => c::S_IFREG as RawMode,
Self::Directory => c::S_IFDIR as RawMode,
Self::Symlink => c::S_IFLNK as RawMode,
#[cfg(not(target_os = "wasi"))] Self::Fifo => c::S_IFIFO as RawMode,
#[cfg(not(target_os = "wasi"))] Self::Socket => c::S_IFSOCK as RawMode,
Self::CharacterDevice => c::S_IFCHR as RawMode,
Self::BlockDevice => c::S_IFBLK as RawMode,
Self::Unknown => c::S_IFMT as RawMode,
}
}
#[cfg(not(any(
target_os = "haiku",
target_os = "illumos",
target_os = "redox",
target_os = "solaris"
)))]
pub(crate) const fn from_dirent_d_type(d_type: u8) -> Self {
match d_type {
c::DT_REG => Self::RegularFile,
c::DT_DIR => Self::Directory,
c::DT_LNK => Self::Symlink,
#[cfg(not(target_os = "wasi"))] c::DT_SOCK => Self::Socket,
#[cfg(not(target_os = "wasi"))] c::DT_FIFO => Self::Fifo,
c::DT_CHR => Self::CharacterDevice,
c::DT_BLK => Self::BlockDevice,
_ => Self::Unknown,
}
}
}
#[cfg(not(any(
target_os = "dragonfly",
target_os = "haiku",
target_os = "illumos",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "redox",
target_os = "solaris",
)))]
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
#[repr(u32)]
pub enum Advice {
Normal = c::POSIX_FADV_NORMAL as c::c_uint,
Sequential = c::POSIX_FADV_SEQUENTIAL as c::c_uint,
Random = c::POSIX_FADV_RANDOM as c::c_uint,
NoReuse = c::POSIX_FADV_NOREUSE as c::c_uint,
WillNeed = c::POSIX_FADV_WILLNEED as c::c_uint,
DontNeed = c::POSIX_FADV_DONTNEED as c::c_uint,
}
#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))]
bitflags! {
pub struct MemfdFlags: c::c_uint {
const CLOEXEC = c::MFD_CLOEXEC;
const ALLOW_SEALING = c::MFD_ALLOW_SEALING;
const HUGETLB = c::MFD_HUGETLB;
#[cfg(any(target_os = "android", target_os = "linux"))]
const HUGE_64KB = c::MFD_HUGE_64KB;
#[cfg(any(target_os = "android", target_os = "linux"))]
const HUGE_512KB = c::MFD_HUGE_512KB;
#[cfg(any(target_os = "android", target_os = "linux"))]
const HUGE_1MB = c::MFD_HUGE_1MB;
#[cfg(any(target_os = "android", target_os = "linux"))]
const HUGE_2MB = c::MFD_HUGE_2MB;
#[cfg(any(target_os = "android", target_os = "linux"))]
const HUGE_8MB = c::MFD_HUGE_8MB;
#[cfg(any(target_os = "android", target_os = "linux"))]
const HUGE_16MB = c::MFD_HUGE_16MB;
#[cfg(any(target_os = "android", target_os = "linux"))]
const HUGE_32MB = c::MFD_HUGE_32MB;
#[cfg(any(target_os = "android", target_os = "linux"))]
const HUGE_256MB = c::MFD_HUGE_256MB;
#[cfg(any(target_os = "android", target_os = "linux"))]
const HUGE_512MB = c::MFD_HUGE_512MB;
#[cfg(any(target_os = "android", target_os = "linux"))]
const HUGE_1GB = c::MFD_HUGE_1GB;
#[cfg(any(target_os = "android", target_os = "linux"))]
const HUGE_2GB = c::MFD_HUGE_2GB;
#[cfg(any(target_os = "android", target_os = "linux"))]
const HUGE_16GB = c::MFD_HUGE_16GB;
}
}
#[cfg(any(
target_os = "android",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "linux",
))]
bitflags! {
pub struct SealFlags: i32 {
const SEAL = c::F_SEAL_SEAL;
const SHRINK = c::F_SEAL_SHRINK;
const GROW = c::F_SEAL_GROW;
const WRITE = c::F_SEAL_WRITE;
#[cfg(any(target_os = "android", target_os = "linux"))]
const FUTURE_WRITE = c::F_SEAL_FUTURE_WRITE;
}
}
#[cfg(all(target_os = "linux", target_env = "gnu"))]
bitflags! {
pub struct StatxFlags: u32 {
const TYPE = c::STATX_TYPE;
const MODE = c::STATX_MODE;
const NLINK = c::STATX_NLINK;
const UID = c::STATX_UID;
const GID = c::STATX_GID;
const ATIME = c::STATX_ATIME;
const MTIME = c::STATX_MTIME;
const CTIME = c::STATX_CTIME;
const INO = c::STATX_INO;
const SIZE = c::STATX_SIZE;
const BLOCKS = c::STATX_BLOCKS;
const BASIC_STATS = c::STATX_BASIC_STATS;
const BTIME = c::STATX_BTIME;
const MNT_ID = c::STATX_MNT_ID;
const ALL = c::STATX_ALL;
}
}
#[cfg(any(
target_os = "android",
all(target_os = "linux", not(target_env = "gnu")),
))]
bitflags! {
pub struct StatxFlags: u32 {
const TYPE = 0x0001;
const MODE = 0x0002;
const NLINK = 0x0004;
const UID = 0x0008;
const GID = 0x0010;
const ATIME = 0x0020;
const MTIME = 0x0040;
const CTIME = 0x0080;
const INO = 0x0100;
const SIZE = 0x0200;
const BLOCKS = 0x0400;
const BASIC_STATS = 0x07ff;
const BTIME = 0x800;
const MNT_ID = 0x1000;
const ALL = 0xfff;
}
}
#[cfg(not(any(
target_os = "aix",
target_os = "illumos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "redox",
target_os = "solaris",
)))]
bitflags! {
pub struct FallocateFlags: i32 {
#[cfg(not(any(
target_os = "aix",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "haiku",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "wasi",
)))]
const KEEP_SIZE = c::FALLOC_FL_KEEP_SIZE;
#[cfg(not(any(
target_os = "aix",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "haiku",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "wasi",
)))]
const PUNCH_HOLE = c::FALLOC_FL_PUNCH_HOLE;
#[cfg(not(any(
target_os = "aix",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "haiku",
target_os = "ios",
target_os = "linux",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "emscripten",
target_os = "fuchsia",
target_os = "wasi",
)))]
const NO_HIDE_STALE = c::FALLOC_FL_NO_HIDE_STALE;
#[cfg(not(any(
target_os = "aix",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "haiku",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "emscripten",
target_os = "wasi",
)))]
const COLLAPSE_RANGE = c::FALLOC_FL_COLLAPSE_RANGE;
#[cfg(not(any(
target_os = "aix",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "haiku",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "emscripten",
target_os = "wasi",
)))]
const ZERO_RANGE = c::FALLOC_FL_ZERO_RANGE;
#[cfg(not(any(
target_os = "aix",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "haiku",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "emscripten",
target_os = "wasi",
)))]
const INSERT_RANGE = c::FALLOC_FL_INSERT_RANGE;
#[cfg(not(any(
target_os = "aix",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "haiku",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "emscripten",
target_os = "wasi",
)))]
const UNSHARE_RANGE = c::FALLOC_FL_UNSHARE_RANGE;
}
}
#[cfg(not(any(
target_os = "haiku",
target_os = "illumos",
target_os = "redox",
target_os = "solaris",
target_os = "wasi",
)))]
bitflags! {
pub struct StatVfsMountFlags: u64 {
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))]
const MANDLOCK = libc::ST_MANDLOCK as u64;
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))]
const NOATIME = libc::ST_NOATIME as u64;
#[cfg(any(target_os = "aix", target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))]
const NODEV = libc::ST_NODEV as u64;
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))]
const NODIRATIME = libc::ST_NODIRATIME as u64;
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))]
const NOEXEC = libc::ST_NOEXEC as u64;
const NOSUID = libc::ST_NOSUID as u64;
const RDONLY = libc::ST_RDONLY as u64;
#[cfg(any(target_os = "android", all(target_os = "linux", target_env = "gnu")))]
const RELATIME = libc::ST_RELATIME as u64;
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))]
const SYNCHRONOUS = libc::ST_SYNCHRONOUS as u64;
}
}
#[cfg(not(any(target_os = "solaris", target_os = "wasi")))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(i32)]
pub enum FlockOperation {
LockShared = c::LOCK_SH,
LockExclusive = c::LOCK_EX,
Unlock = c::LOCK_UN,
NonBlockingLockShared = c::LOCK_SH | c::LOCK_NB,
NonBlockingLockExclusive = c::LOCK_EX | c::LOCK_NB,
NonBlockingUnlock = c::LOCK_UN | c::LOCK_NB,
}
#[cfg(not(any(
target_os = "android",
target_os = "linux",
target_os = "emscripten",
target_os = "l4re",
)))]
pub type Stat = c::stat;
#[cfg(any(
all(
any(target_os = "android", target_os = "linux"),
target_pointer_width = "64",
),
target_os = "emscripten",
target_os = "l4re",
))]
pub type Stat = c::stat64;
#[cfg(all(
any(target_os = "android", target_os = "linux"),
target_pointer_width = "32",
))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[allow(missing_docs)]
pub struct Stat {
pub st_dev: u64,
pub st_mode: u32,
pub st_nlink: u32,
pub st_uid: u32,
pub st_gid: u32,
pub st_rdev: u64,
pub st_size: i64,
pub st_blksize: u32,
pub st_blocks: u64,
pub st_atime: u64,
pub st_atime_nsec: u32,
pub st_mtime: u64,
pub st_mtime_nsec: u32,
pub st_ctime: u64,
pub st_ctime_nsec: u32,
pub st_ino: u64,
}
#[cfg(not(any(
target_os = "android",
target_os = "emscripten",
target_os = "haiku",
target_os = "illumos",
target_os = "linux",
target_os = "l4re",
target_os = "netbsd",
target_os = "redox",
target_os = "solaris",
target_os = "wasi",
)))]
#[allow(clippy::module_name_repetitions)]
pub type StatFs = c::statfs;
#[cfg(any(
target_os = "android",
target_os = "linux",
target_os = "emscripten",
target_os = "l4re",
))]
pub type StatFs = c::statfs64;
#[cfg(not(any(
target_os = "haiku",
target_os = "illumos",
target_os = "redox",
target_os = "solaris",
target_os = "wasi",
)))]
#[allow(missing_docs)]
pub struct StatVfs {
pub f_bsize: u64,
pub f_frsize: u64,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: u64,
pub f_files: u64,
pub f_ffree: u64,
pub f_favail: u64,
pub f_fsid: u64,
pub f_flag: StatVfsMountFlags,
pub f_namemax: u64,
}
#[cfg(all(target_os = "linux", target_env = "gnu"))]
pub type Statx = c::statx;
#[cfg(all(target_os = "linux", target_env = "gnu"))]
pub type StatxTimestamp = c::statx;
#[cfg(any(
target_os = "android",
all(target_os = "linux", not(target_env = "gnu")),
))]
#[repr(C)]
#[allow(missing_docs)]
pub struct Statx {
pub stx_mask: u32,
pub stx_blksize: u32,
pub stx_attributes: u64,
pub stx_nlink: u32,
pub stx_uid: u32,
pub stx_gid: u32,
pub stx_mode: u16,
__statx_pad1: [u16; 1],
pub stx_ino: u64,
pub stx_size: u64,
pub stx_blocks: u64,
pub stx_attributes_mask: u64,
pub stx_atime: StatxTimestamp,
pub stx_btime: StatxTimestamp,
pub stx_ctime: StatxTimestamp,
pub stx_mtime: StatxTimestamp,
pub stx_rdev_major: u32,
pub stx_rdev_minor: u32,
pub stx_dev_major: u32,
pub stx_dev_minor: u32,
pub stx_mnt_id: u64,
__statx_pad2: u64,
__statx_pad3: [u64; 12],
}
#[cfg(any(
target_os = "android",
all(target_os = "linux", not(target_env = "gnu")),
))]
#[repr(C)]
#[allow(missing_docs)]
pub struct StatxTimestamp {
pub tv_sec: i64,
pub tv_nsec: u32,
pub __statx_timestamp_pad1: [i32; 1],
}
#[cfg(not(all(target_os = "android", target_pointer_width = "32")))]
pub type RawMode = c::mode_t;
#[cfg(all(target_os = "android", target_pointer_width = "32"))]
pub type RawMode = c::c_uint;
#[cfg(not(all(target_os = "android", target_pointer_width = "32")))]
pub type Dev = c::dev_t;
#[cfg(all(target_os = "android", target_pointer_width = "32"))]
pub type Dev = c::c_ulonglong;
#[cfg(all(
target_os = "linux",
not(target_env = "musl"),
not(target_arch = "s390x"),
))]
pub type FsWord = c::__fsword_t;
#[cfg(all(
any(target_os = "android", all(target_os = "linux", target_env = "musl")),
target_pointer_width = "32",
))]
pub type FsWord = u32;
#[cfg(all(
any(target_os = "android", all(target_os = "linux", target_env = "musl")),
not(target_arch = "s390x"),
target_pointer_width = "64",
))]
pub type FsWord = u64;
#[cfg(all(target_os = "linux", target_arch = "s390x"))]
pub type FsWord = u32;
#[cfg(not(target_os = "redox"))]
pub use c::{UTIME_NOW, UTIME_OMIT};
#[cfg(all(
any(target_os = "android", target_os = "linux"),
not(target_env = "musl"),
))]
pub const PROC_SUPER_MAGIC: FsWord = c::PROC_SUPER_MAGIC as FsWord;
#[cfg(all(
any(target_os = "android", target_os = "linux"),
not(target_env = "musl"),
))]
pub const NFS_SUPER_MAGIC: FsWord = c::NFS_SUPER_MAGIC as FsWord;
#[cfg(all(any(target_os = "android", target_os = "linux"), target_env = "musl"))]
pub const PROC_SUPER_MAGIC: FsWord = 0x0000_9fa0;
#[cfg(all(any(target_os = "android", target_os = "linux"), target_env = "musl"))]
pub const NFS_SUPER_MAGIC: FsWord = 0x0000_6969;
#[cfg(any(target_os = "ios", target_os = "macos"))]
#[allow(non_camel_case_types)]
#[repr(transparent)]
#[derive(Copy, Clone)]
pub struct copyfile_state_t(pub(crate) *mut c::c_void);
#[cfg(any(target_os = "android", target_os = "linux"))]
bitflags! {
pub struct MountFlags: c::c_ulong {
const BIND = c::MS_BIND;
const DIRSYNC = c::MS_DIRSYNC;
const LAZYTIME = c::MS_LAZYTIME;
#[doc(alias = "MANDLOCK")]
const PERMIT_MANDATORY_FILE_LOCKING = c::MS_MANDLOCK;
const NOATIME = c::MS_NOATIME;
const NODEV = c::MS_NODEV;
const NODIRATIME = c::MS_NODIRATIME;
const NOEXEC = c::MS_NOEXEC;
const NOSUID = c::MS_NOSUID;
const RDONLY = c::MS_RDONLY;
const REC = c::MS_REC;
const RELATIME = c::MS_RELATIME;
const SILENT = c::MS_SILENT;
const STRICTATIME = c::MS_STRICTATIME;
const SYNCHRONOUS = c::MS_SYNCHRONOUS;
}
}
#[cfg(any(target_os = "android", target_os = "linux"))]
bitflags! {
pub struct MountPropagationFlags: c::c_ulong {
const SHARED = c::MS_SHARED;
const PRIVATE = c::MS_PRIVATE;
const SLAVE = c::MS_SLAVE;
const UNBINDABLE = c::MS_UNBINDABLE;
const REC = c::MS_REC;
}
}
#[cfg(any(target_os = "android", target_os = "linux"))]
bitflags! {
pub(crate) struct InternalMountFlags: c::c_ulong {
const REMOUNT = c::MS_REMOUNT;
const MOVE = c::MS_MOVE;
}
}
#[cfg(any(target_os = "android", target_os = "linux"))]
pub(crate) struct MountFlagsArg(pub(crate) c::c_ulong);