Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue1814 add domainname field of utsname on android and linux #1817

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
([#1804](https://github.com/nix-rust/nix/pull/1804))
- Added `line_discipline` field to `Termios` on Linux, Android and Haiku
([#1805](https://github.com/nix-rust/nix/pull/1805))
- Added `domainname` field of `UtsName` on Android and Linux
([#1817](https://github.com/nix-rust/nix/pull/1817))

### Changed

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