#posix #hostname #uname #utsname

uname-rs

No dependency, panic-less implementation of the POSIX utsname header and struct in Rust

2 releases

0.1.1 May 4, 2021
0.1.0 May 1, 2021

#903 in Unix APIs

Download history 607/week @ 2024-09-06 479/week @ 2024-09-13 821/week @ 2024-09-20 693/week @ 2024-09-27 621/week @ 2024-10-04 617/week @ 2024-10-11 579/week @ 2024-10-18 742/week @ 2024-10-25 647/week @ 2024-11-01 697/week @ 2024-11-08 584/week @ 2024-11-15 930/week @ 2024-11-22 1094/week @ 2024-11-29 867/week @ 2024-12-06 966/week @ 2024-12-13 809/week @ 2024-12-20

3,913 downloads per month
Used in 4 crates (via bpf-compatible-rs)

Apache-2.0

6KB
53 lines

Uname-rs

No dependency, panic-less implementation of the POSIX utsname header and struct in Rust.

Taken from my project rfetch

use std::io::Result;
use uname_rs::Uname;

fn main() -> Result<()> {
	let uts = Uname::new()?;

	println!("{}", uts.sysname);

	Ok(())
}

No runtime deps