Skip to content

Commit

Permalink
Initial support for AIX operating system
Browse files Browse the repository at this point in the history
  • Loading branch information
ecnelises committed Sep 21, 2022
1 parent be36bf0 commit 836a2b0
Show file tree
Hide file tree
Showing 13 changed files with 337 additions and 19 deletions.
15 changes: 11 additions & 4 deletions src/dir.rs
Expand Up @@ -210,7 +210,8 @@ impl Entry {
#[allow(clippy::useless_conversion)] // Not useless on all OSes
pub fn ino(&self) -> u64 {
cfg_if! {
if #[cfg(any(target_os = "android",
if #[cfg(any(target_os = "aix",
target_os = "android",
target_os = "emscripten",
target_os = "fuchsia",
target_os = "haiku",
Expand Down Expand Up @@ -238,7 +239,10 @@ 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 = "illumos", target_os = "solaris", target_os = "haiku")))]
#[cfg(not(any(target_os = "aix",
target_os = "illumos",
target_os = "solaris",
target_os = "haiku")))]
match self.0.d_type {
libc::DT_FIFO => Some(Type::Fifo),
libc::DT_CHR => Some(Type::CharacterDevice),
Expand All @@ -250,8 +254,11 @@ impl Entry {
/* libc::DT_UNKNOWN | */ _ => None,
}

// illumos, Solaris, and Haiku systems do not have the d_type member at all:
#[cfg(any(target_os = "illumos", target_os = "solaris", target_os = "haiku"))]
// AIX, 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"))]
None
}
}

0 comments on commit 836a2b0

Please sign in to comment.