summaryrefslogtreecommitdiffstats
path: root/third_party/rust/nix/src/dir.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/nix/src/dir.rs')
-rw-r--r--third_party/rust/nix/src/dir.rs27
1 files changed, 7 insertions, 20 deletions
diff --git a/third_party/rust/nix/src/dir.rs b/third_party/rust/nix/src/dir.rs
index 96a5843bc6..ab70f064cc 100644
--- a/third_party/rust/nix/src/dir.rs
+++ b/third_party/rust/nix/src/dir.rs
@@ -44,7 +44,7 @@ impl Dir {
/// Opens the given path as with `fcntl::openat`.
pub fn openat<P: ?Sized + NixPath>(
- dirfd: RawFd,
+ dirfd: Option<RawFd>,
path: &P,
oflag: OFlag,
mode: sys::stat::Mode,
@@ -225,16 +225,13 @@ impl Entry {
pub fn ino(&self) -> u64 {
cfg_if! {
if #[cfg(any(target_os = "aix",
- target_os = "android",
target_os = "emscripten",
target_os = "fuchsia",
target_os = "haiku",
- target_os = "illumos",
- target_os = "ios",
- target_os = "l4re",
- target_os = "linux",
- target_os = "macos",
- target_os = "solaris"))] {
+ target_os = "hurd",
+ solarish,
+ linux_android,
+ apple_targets))] {
self.0.d_ino as u64
} else {
u64::from(self.0.d_fileno)
@@ -253,12 +250,7 @@ impl Entry {
/// notably, some Linux filesystems don't implement this. The caller should use `stat` or
/// `fstat` if this returns `None`.
pub fn file_type(&self) -> Option<Type> {
- #[cfg(not(any(
- target_os = "aix",
- target_os = "illumos",
- target_os = "solaris",
- target_os = "haiku"
- )))]
+ #[cfg(not(any(solarish, target_os = "aix", target_os = "haiku")))]
match self.0.d_type {
libc::DT_FIFO => Some(Type::Fifo),
libc::DT_CHR => Some(Type::CharacterDevice),
@@ -271,12 +263,7 @@ impl Entry {
}
// illumos, Solaris, and Haiku systems do not have the d_type member at all:
- #[cfg(any(
- target_os = "aix",
- target_os = "illumos",
- target_os = "solaris",
- target_os = "haiku"
- ))]
+ #[cfg(any(solarish, target_os = "aix", target_os = "haiku"))]
None
}
}