summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/backend/libc/fs/types.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/rustix/src/backend/libc/fs/types.rs')
-rw-r--r--vendor/rustix/src/backend/libc/fs/types.rs97
1 files changed, 71 insertions, 26 deletions
diff --git a/vendor/rustix/src/backend/libc/fs/types.rs b/vendor/rustix/src/backend/libc/fs/types.rs
index 955bdaa29..cf86861dc 100644
--- a/vendor/rustix/src/backend/libc/fs/types.rs
+++ b/vendor/rustix/src/backend/libc/fs/types.rs
@@ -20,6 +20,9 @@ bitflags! {
/// `F_OK`
const EXISTS = c::F_OK;
+
+ /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ const _ = !0;
}
}
@@ -73,6 +76,9 @@ bitflags! {
/// `AT_STATX_DONT_SYNC`
#[cfg(all(target_os = "linux", target_env = "gnu"))]
const STATX_DONT_SYNC = bitcast!(c::AT_STATX_DONT_SYNC);
+
+ /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ const _ = !0;
}
}
@@ -86,64 +92,67 @@ bitflags! {
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub struct Mode: RawMode {
/// `S_IRWXU`
- #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(target_os = "espidf"))]
const RWXU = c::S_IRWXU as RawMode;
/// `S_IRUSR`
- #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(target_os = "espidf"))]
const RUSR = c::S_IRUSR as RawMode;
/// `S_IWUSR`
- #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(target_os = "espidf"))]
const WUSR = c::S_IWUSR as RawMode;
/// `S_IXUSR`
- #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(target_os = "espidf"))]
const XUSR = c::S_IXUSR as RawMode;
/// `S_IRWXG`
- #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(target_os = "espidf"))]
const RWXG = c::S_IRWXG as RawMode;
/// `S_IRGRP`
- #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(target_os = "espidf"))]
const RGRP = c::S_IRGRP as RawMode;
/// `S_IWGRP`
- #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(target_os = "espidf"))]
const WGRP = c::S_IWGRP as RawMode;
/// `S_IXGRP`
- #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(target_os = "espidf"))]
const XGRP = c::S_IXGRP as RawMode;
/// `S_IRWXO`
- #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(target_os = "espidf"))]
const RWXO = c::S_IRWXO as RawMode;
/// `S_IROTH`
- #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(target_os = "espidf"))]
const ROTH = c::S_IROTH as RawMode;
/// `S_IWOTH`
- #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(target_os = "espidf"))]
const WOTH = c::S_IWOTH as RawMode;
/// `S_IXOTH`
- #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(target_os = "espidf"))]
const XOTH = c::S_IXOTH as RawMode;
/// `S_ISUID`
- #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(target_os = "espidf"))]
const SUID = c::S_ISUID as RawMode;
/// `S_ISGID`
- #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(target_os = "espidf"))]
const SGID = c::S_ISGID as RawMode;
/// `S_ISVTX`
- #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(target_os = "espidf"))]
const SVTX = c::S_ISVTX as RawMode;
+
+ /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ const _ = !0;
}
}
@@ -249,6 +258,8 @@ bitflags! {
const WRONLY = bitcast!(c::O_WRONLY);
/// `O_RDWR`
+ ///
+ /// This is not equal to `RDONLY | WRONLY`. It's a distinct flag.
const RDWR = bitcast!(c::O_RDWR);
/// `O_NOCTTY`
@@ -316,6 +327,9 @@ bitflags! {
/// `O_EMPTY_PATH`
#[cfg(target_os = "freebsd")]
const EMPTY_PATH = bitcast!(c::O_EMPTY_PATH);
+
+ /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ const _ = !0;
}
}
@@ -332,6 +346,9 @@ bitflags! {
/// `CLONE_NOOWNERCOPY`
const NOOWNERCOPY = 2;
+
+ /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ const _ = !0;
}
}
@@ -374,6 +391,9 @@ bitflags! {
/// `COPYFILE_ALL`
const ALL = copyfile::ALL;
+
+ /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ const _ = !0;
}
}
@@ -402,6 +422,9 @@ bitflags! {
/// `RESOLVE_CACHED` (since Linux 5.12)
const CACHED = 0x20;
+
+ /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ const _ = !0;
}
}
@@ -421,6 +444,9 @@ bitflags! {
/// `RENAME_WHITEOUT`
const WHITEOUT = bitcast!(c::RENAME_WHITEOUT);
+
+ /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ const _ = !0;
}
}
@@ -497,6 +523,7 @@ impl FileType {
/// Construct a `FileType` from the `d_type` field of a `c::dirent`.
#[cfg(not(any(
solarish,
+ target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "nto",
@@ -595,6 +622,9 @@ bitflags! {
const HUGE_2GB = c::MFD_HUGE_2GB;
/// `MFD_HUGE_16GB`
const HUGE_16GB = c::MFD_HUGE_16GB;
+
+ /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ const _ = !0;
}
}
@@ -608,17 +638,20 @@ bitflags! {
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub struct SealFlags: u32 {
- /// `F_SEAL_SEAL`.
- const SEAL = bitcast!(c::F_SEAL_SEAL);
- /// `F_SEAL_SHRINK`.
- const SHRINK = bitcast!(c::F_SEAL_SHRINK);
- /// `F_SEAL_GROW`.
- const GROW = bitcast!(c::F_SEAL_GROW);
- /// `F_SEAL_WRITE`.
- const WRITE = bitcast!(c::F_SEAL_WRITE);
- /// `F_SEAL_FUTURE_WRITE` (since Linux 5.1)
- #[cfg(linux_kernel)]
- const FUTURE_WRITE = bitcast!(c::F_SEAL_FUTURE_WRITE);
+ /// `F_SEAL_SEAL`.
+ const SEAL = bitcast!(c::F_SEAL_SEAL);
+ /// `F_SEAL_SHRINK`.
+ const SHRINK = bitcast!(c::F_SEAL_SHRINK);
+ /// `F_SEAL_GROW`.
+ const GROW = bitcast!(c::F_SEAL_GROW);
+ /// `F_SEAL_WRITE`.
+ const WRITE = bitcast!(c::F_SEAL_WRITE);
+ /// `F_SEAL_FUTURE_WRITE` (since Linux 5.1)
+ #[cfg(linux_kernel)]
+ const FUTURE_WRITE = bitcast!(c::F_SEAL_FUTURE_WRITE);
+
+ /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ const _ = !0;
}
}
@@ -677,6 +710,9 @@ bitflags! {
/// `STATX_ALL`
const ALL = c::STATX_ALL;
+
+ /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ const _ = !0;
}
}
@@ -735,6 +771,9 @@ bitflags! {
/// `STATX_ALL`
const ALL = 0xfff;
+
+ /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ const _ = !0;
}
}
@@ -817,6 +856,9 @@ bitflags! {
target_os = "wasi",
)))]
const UNSHARE_RANGE = bitcast!(c::FALLOC_FL_UNSHARE_RANGE);
+
+ /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ const _ = !0;
}
}
@@ -866,6 +908,9 @@ bitflags! {
/// `ST_SYNCHRONOUS`
#[cfg(any(linux_kernel, target_os = "emscripten", target_os = "fuchsia"))]
const SYNCHRONOUS = c::ST_SYNCHRONOUS as u64;
+
+ /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ const _ = !0;
}
}