From 2a0bfb8bd55b2e6efe337a443b9968a6a8842240 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Tue, 25 Mar 2025 10:40:51 +0100 Subject: [PATCH] hostid: use gethostid from Rust libc --- src/uu/hostid/src/hostid.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/uu/hostid/src/hostid.rs b/src/uu/hostid/src/hostid.rs index 921e9c724..a01151dde 100644 --- a/src/uu/hostid/src/hostid.rs +++ b/src/uu/hostid/src/hostid.rs @@ -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)?;