Skip to content

Commit

Permalink
add support for Illumos
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
siepkes committed Jun 13, 2023
1 parent 6a66620 commit 343298f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/lib_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
};
Expand Down
8 changes: 6 additions & 2 deletions src/platform/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 343298f

Please sign in to comment.