mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
Merge pull request #7571 from cakebaker/hostid_use_libc
hostid: use `gethostid` from Rust `libc`
This commit is contained in:
commit
2488e17aef
1 changed files with 1 additions and 6 deletions
|
@ -6,17 +6,12 @@
|
||||||
// spell-checker:ignore (ToDO) gethostid
|
// spell-checker:ignore (ToDO) gethostid
|
||||||
|
|
||||||
use clap::Command;
|
use clap::Command;
|
||||||
use libc::c_long;
|
use libc::{c_long, gethostid};
|
||||||
use uucore::{error::UResult, format_usage, help_about, help_usage};
|
use uucore::{error::UResult, format_usage, help_about, help_usage};
|
||||||
|
|
||||||
const USAGE: &str = help_usage!("hostid.md");
|
const USAGE: &str = help_usage!("hostid.md");
|
||||||
const ABOUT: &str = help_about!("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]
|
#[uucore::main]
|
||||||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
uu_app().try_get_matches_from(args)?;
|
uu_app().try_get_matches_from(args)?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue