Skip to content

Commit

Permalink
Support AIX operating system
Browse files Browse the repository at this point in the history
  • Loading branch information
ecnelises committed Aug 29, 2022
1 parent 41c9d38 commit 6f4f2a2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/lib.rs
Expand Up @@ -38,6 +38,7 @@
path = "tz_illumos.rs"
)]
#[cfg_attr(target_os = "android", path = "tz_android.rs")]
#[cfg_attr(target_os = "aix", path = "tz_aix.rs")]
mod platform;

/// Error types
Expand Down
2 changes: 1 addition & 1 deletion src/platform.rs
Expand Up @@ -5,5 +5,5 @@ pub fn get_timezone_inner() -> std::result::Result<String, crate::GetTimezoneErr
#[cfg(not(feature = "fallback"))]
compile_error!(
"iana-time-zone is currently implemented for Linux, Window, MacOS, FreeBSD, NetBSD, \
OpenBSD, Dragonfly, WebAssembly (browser), iOS, Illumos, Android, and Solaris.",
OpenBSD, Dragonfly, WebAssembly (browser), iOS, Illumos, Android, AIX and Solaris.",
);
5 changes: 5 additions & 0 deletions src/tz_aix.rs
@@ -0,0 +1,5 @@
use std::env;

pub(crate) fn get_timezone_inner() -> Result<String, crate::GetTimezoneError> {
env::var("TZ").map_err(|_| crate::GetTimezoneError::OsError)
}

0 comments on commit 6f4f2a2

Please sign in to comment.