Skip to content

Commit

Permalink
Merge #1817
Browse files Browse the repository at this point in the history
1817: fix issue1814 add domainname field of utsname on android and linux r=asomers a=SteveLauC

Closes #1814 

Co-authored-by: Steve Lau <stevelauc@outlook.com>
Co-authored-by: SteveLau <stevelauc@outlook.com>
  • Loading branch information
bors[bot] and SteveLauC committed Sep 17, 2022
2 parents 1038ee5 + 50b41a8 commit be36bf0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/sys/utsname.rs
Expand Up @@ -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
Expand Down

0 comments on commit be36bf0

Please sign in to comment.