Skip to content

Commit be36bf0

Browse files
bors[bot]SteveLauC
andauthored
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>
2 parents 1038ee5 + 50b41a8 commit be36bf0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1212
([#1805](https://github.com/nix-rust/nix/pull/1805))
1313
- Expose the memfd module on FreeBSD (memfd was added in FreeBSD 13)
1414
([#1808](https://github.com/nix-rust/nix/pull/1808))
15-
15+
- Added `domainname` field of `UtsName` on Android and Linux
16+
([#1817](https://github.com/nix-rust/nix/pull/1817))
17+
1618
### Changed
1719

1820
- The MSRV is now 1.56.1

src/sys/utsname.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ impl UtsName {
3535
pub fn machine(&self) -> &OsStr {
3636
cast_and_trim(&self.0.machine)
3737
}
38+
39+
/// NIS or YP domain name of this machine.
40+
#[cfg(any(target_os = "android", target_os = "linux"))]
41+
pub fn domainname(&self) -> &OsStr {
42+
cast_and_trim(&self.0.domainname)
43+
}
3844
}
3945

4046
/// Get system identification

0 commit comments

Comments
 (0)