summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-09-17 17:02:46 +0000
committerGitHub <noreply@github.com>2022-09-17 17:02:46 +0000
commitbe36bf05478ac40f92a01e1e8ec6aa11fad65d1f (patch)
treeda7a7cc77022d5f31c85515ca62f85ebde1b1d5b
parent1038ee53409e5955fc68416fd140f831b9a88e5c (diff)
parent50b41a8c4c8428ac5502151565a09ea5857b99da (diff)
downloadnix-be36bf05478ac40f92a01e1e8ec6aa11fad65d1f.zip
Merge #1817
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>
-rw-r--r--CHANGELOG.md4
-rw-r--r--src/sys/utsname.rs6
2 files changed, 9 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 74bf755c..5982d70c 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 5bd3a539..0448cb29 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