diff --git a/src/lib.rs b/src/lib.rs index 39262580..c163515d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -209,7 +209,7 @@ pub use crate::error::Error; // The function MUST NOT ever write uninitialized bytes into `dest`, // regardless of what value it returns. cfg_if! { - if #[cfg(any(target_os = "haiku", target_os = "redox"))] { + if #[cfg(any(target_os = "haiku", target_os = "redox", target_os = "aix"))] { mod util_libc; #[path = "use_file.rs"] mod imp; } else if #[cfg(any(target_os = "android", target_os = "linux"))] { diff --git a/src/use_file.rs b/src/use_file.rs index facd8fad..13f306d1 100644 --- a/src/use_file.rs +++ b/src/use_file.rs @@ -25,6 +25,7 @@ use core::{ #[cfg(any(target_os = "solaris", target_os = "illumos"))] const FILE_PATH: &str = "/dev/random\0"; #[cfg(any( + target_os = "aix", target_os = "android", target_os = "linux", target_os = "redox", diff --git a/src/util_libc.rs b/src/util_libc.rs index 6c80b3fe..4ed9403f 100644 --- a/src/util_libc.rs +++ b/src/util_libc.rs @@ -32,6 +32,8 @@ cfg_if! { fn __errno() -> *mut libc::c_int; } use __errno as errno_location; + } else if #[cfg(target_os = "aix")] { + use libc::_Errno as errno_location; } }