rust: utils: Add 'gethostname()' function

Add 'gethostname' function to retrieve the system hostname using libc
gethostname.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <marc@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2026-02-12 12:00:40 +01:00
committed by Jan Höppner
parent 95fb1e2b03
commit 893667e73e
2 changed files with 69 additions and 0 deletions
+2
View File
@@ -7,6 +7,7 @@ mod cli;
mod exit_code;
mod file;
mod hexslice;
mod hostname;
mod log;
mod tmpfile;
@@ -20,6 +21,7 @@ pub use crate::{
exit_code::{docstring, ExitCodeDoc, ExitCodeTrait, ExitCodeVariantDoc},
file::{AtomicFile, AtomicFileOperation},
hexslice::HexSlice,
hostname::gethostname,
log::PvLogger,
tmpfile::TemporaryDirectory,
};