From 343298f2fc5e72bc83b758ac275c806e255b9aa4 Mon Sep 17 00:00:00 2001 From: Jasper Siepkes Date: Mon, 12 Jun 2023 16:46:26 +0200 Subject: [PATCH] add support for Illumos This commit introduces support for Illumos, an (Open) Solaris derivative. It also clarifies the documentation a bit on why the domainname field is missing for OS'es like the BSD's and Illumos. --- src/lib_impl.rs | 2 ++ src/platform/unix.rs | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib_impl.rs b/src/lib_impl.rs index 180de27..c9c8a91 100644 --- a/src/lib_impl.rs +++ b/src/lib_impl.rs @@ -52,6 +52,8 @@ const HOST_OS_NAME: &str = if cfg!(all( "Fuchsia" } else if cfg!(target_os = "redox") { "Redox" +} else if cfg!(target_os = "illumos") { + "Illumos" } else { "unknown" }; diff --git a/src/platform/unix.rs b/src/platform/unix.rs index 24414ed..30153ca 100644 --- a/src/platform/unix.rs +++ b/src/platform/unix.rs @@ -115,8 +115,10 @@ impl Debug for UTSName { .field("release", &oss_from_cstr(&self.0.release)) .field("version", &oss_from_cstr(&self.0.version)) .field("machine", &oss_from_cstr(&self.0.machine)); - // BSD-like platforms are missing the domainname field + // The domainname field is not part of the POSIX standard but a GNU extension. Therefor + // BSD-like platforms and Illumos are missing the domainname field. #[cfg(not(any( + target_os = "illumos", target_os = "macos", target_os = "dragonfly", target_os = "freebsd", @@ -147,8 +149,10 @@ impl PartialEq for UTSName { other.0.version, other.0.machine, ); - // BSD-like platforms are missing the domainname field + // The domainname field is not part of the POSIX standard but a GNU extension. Therefor + // BSD-like platforms and Illumos are missing the domainname field. #[cfg(not(any( + target_os = "illumos", target_os = "macos", target_os = "dragonfly", target_os = "freebsd",