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.rs35
1 files changed, 20 insertions, 15 deletions
diff --git a/vendor/rustix/src/backend/libc/fs/types.rs b/vendor/rustix/src/backend/libc/fs/types.rs
index f635f2cca..0cf7fe8ff 100644
--- a/vendor/rustix/src/backend/libc/fs/types.rs
+++ b/vendor/rustix/src/backend/libc/fs/types.rs
@@ -138,8 +138,8 @@ bitflags! {
}
impl Mode {
- /// Construct a `Mode` from the mode bits of the `st_mode` field of
- /// a `Stat`.
+ /// Construct a `Mode` from the mode bits of the `st_mode` field of a
+ /// `Stat`.
#[inline]
pub const fn from_raw_mode(st_mode: RawMode) -> Self {
Self::from_bits_truncate(st_mode)
@@ -334,7 +334,9 @@ mod copyfile {
#[cfg(apple)]
bitflags! {
- /// `COPYFILE_*` constants.
+ /// `COPYFILE_*` constants for use with [`fcopyfile`].
+ ///
+ /// [`fcopyfile`]: crate::fs::fcopyfile
pub struct CopyfileFlags: c::c_uint {
/// `COPYFILE_ACL`
const ACL = copyfile::ACL;
@@ -440,6 +442,7 @@ pub enum FileType {
impl FileType {
/// Construct a `FileType` from the `S_IFMT` bits of the `st_mode` field of
/// a `Stat`.
+ #[inline]
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,
@@ -456,6 +459,7 @@ impl FileType {
}
/// Construct an `st_mode` value from `Stat`.
+ #[inline]
pub const fn as_raw_mode(self) -> RawMode {
match self {
Self::RegularFile => c::S_IFREG as RawMode,
@@ -473,6 +477,7 @@ impl FileType {
/// Construct a `FileType` from the `d_type` field of a `c::dirent`.
#[cfg(not(any(solarish, target_os = "haiku", target_os = "redox")))]
+ #[inline]
pub(crate) const fn from_dirent_d_type(d_type: u8) -> Self {
match d_type {
c::DT_REG => Self::RegularFile,
@@ -773,43 +778,43 @@ bitflags! {
}
}
-#[cfg(not(any(solarish, target_os = "haiku", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
bitflags! {
/// `ST_*` constants for use with [`StatVfs`].
pub struct StatVfsMountFlags: u64 {
/// `ST_MANDLOCK`
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))]
- const MANDLOCK = libc::ST_MANDLOCK as u64;
+ const MANDLOCK = c::ST_MANDLOCK as u64;
/// `ST_NOATIME`
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))]
- const NOATIME = libc::ST_NOATIME as u64;
+ const NOATIME = c::ST_NOATIME as u64;
/// `ST_NODEV`
#[cfg(any(target_os = "aix", target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))]
- const NODEV = libc::ST_NODEV as u64;
+ const NODEV = c::ST_NODEV as u64;
/// `ST_NODIRATIME`
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))]
- const NODIRATIME = libc::ST_NODIRATIME as u64;
+ const NODIRATIME = c::ST_NODIRATIME as u64;
/// `ST_NOEXEC`
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))]
- const NOEXEC = libc::ST_NOEXEC as u64;
+ const NOEXEC = c::ST_NOEXEC as u64;
/// `ST_NOSUID`
- const NOSUID = libc::ST_NOSUID as u64;
+ const NOSUID = c::ST_NOSUID as u64;
/// `ST_RDONLY`
- const RDONLY = libc::ST_RDONLY as u64;
+ const RDONLY = c::ST_RDONLY as u64;
/// `ST_RELATIME`
#[cfg(any(target_os = "android", all(target_os = "linux", target_env = "gnu")))]
- const RELATIME = libc::ST_RELATIME as u64;
+ const RELATIME = c::ST_RELATIME as u64;
/// `ST_SYNCHRONOUS`
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))]
- const SYNCHRONOUS = libc::ST_SYNCHRONOUS as u64;
+ const SYNCHRONOUS = c::ST_SYNCHRONOUS as u64;
}
}
@@ -915,7 +920,7 @@ pub type StatFs = c::statfs64;
///
/// [`statvfs`]: crate::fs::statvfs
/// [`fstatvfs`]: crate::fs::fstatvfs
-#[cfg(not(any(solarish, target_os = "haiku", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
#[allow(missing_docs)]
pub struct StatVfs {
pub f_bsize: u64,
@@ -1106,7 +1111,7 @@ bitflags! {
bitflags! {
/// `MS_*` constants for use with [`change_mount`].
///
- /// [`change_mount`]: crate::fs::mount::change_mount.
+ /// [`change_mount`]: crate::fs::mount::change_mount
pub struct MountPropagationFlags: c::c_ulong {
/// `MS_SHARED`
const SHARED = c::MS_SHARED;