diff --git a/CHANGELOG.md b/CHANGELOG.md index 74bf755c09..5982d70c97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,9 @@ This project adheres to [Semantic Versioning](https://semver.org/). ([#1805](https://github.com/nix-rust/nix/pull/1805)) - Expose the memfd module on FreeBSD (memfd was added in FreeBSD 13) ([#1808](https://github.com/nix-rust/nix/pull/1808)) - +- Added `domainname` field of `UtsName` on Android and Linux + ([#1817](https://github.com/nix-rust/nix/pull/1817)) + ### Changed - The MSRV is now 1.56.1 diff --git a/src/sys/utsname.rs b/src/sys/utsname.rs index 5bd3a539ae..0448cb2990 100644 --- a/src/sys/utsname.rs +++ b/src/sys/utsname.rs @@ -35,6 +35,12 @@ impl UtsName { pub fn machine(&self) -> &OsStr { cast_and_trim(&self.0.machine) } + + /// NIS or YP domain name of this machine. + #[cfg(any(target_os = "android", target_os = "linux"))] + pub fn domainname(&self) -> &OsStr { + cast_and_trim(&self.0.domainname) + } } /// Get system identification