1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 11:07:44 +00:00

hostid: use gethostid from Rust libc

This commit is contained in:
Daniel Hofstetter 2025-03-25 10:40:51 +01:00
parent f038d3e716
commit 2a0bfb8bd5

View file

@ -6,17 +6,12 @@
// spell-checker:ignore (ToDO) gethostid
use clap::Command;
use libc::c_long;
use libc::{c_long, gethostid};
use uucore::{error::UResult, format_usage, help_about, help_usage};
const USAGE: &str = help_usage!("hostid.md");
const ABOUT: &str = help_about!("hostid.md");
// currently rust libc interface doesn't include gethostid
unsafe extern "C" {
pub fn gethostid() -> c_long;
}
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
uu_app().try_get_matches_from(args)?;