cluuname 0.1.0

Name and information about the current kernel.
docs.rs failed to build cluuname-0.1.0
Please check build logs and if you believe this is docs.rs' fault, report into this issue report.

Uname

Build Status Apache licensed crates.io Documentation

Name and information about the current kernel.

Print

extern crate cluuname;
use cluuname::uname;

fn main() {
	let uname = uname().unwrap();
	println!("{}", uname);
	//"Linux" "cluComp" "4.15.15-1-zen" "#1 ZEN SMP PREEMPT Sat Mar 31 23:59:18 UTC 2018" "x86_64"
}

2Print

extern crate cluuname;
use cluuname::uname;
use cluuname::UtsName;
use cluuname::build;

fn main() {
	let uname = uname().unwrap();
	nodename(uname);
	//NODENAME "R510"

	let custom_uname = build::linux_216_86();
	nodename(custom_uname);
	//NODENAME "cluComp"
}

fn nodename<T: UtsName>(uname: T) {
	println!("NODENAME {:?}", uname.as_nodename());
}

CustomPrint

extern crate cluuname;
use cluuname::uname;
use cluuname::UtsName;

fn main() {
	let uname = uname().unwrap();

	let sysname = uname.as_sysname();
	let nodename = uname.as_nodename();
	let release = uname.as_release();
	let version = uname.as_version();
	let machine = uname.as_machine();

	println!("{:?} {:?} {:?} {:?} {:?}", sysname, nodename, release, version, machine);
	//"Linux "cluComp" "4.15.15-1-zen" "#1 ZEN SMP PREEMPT Sat Mar 31 23:59:18 UTC 2018" "x86_64"
}

Hash + Hash Version

extern crate cluuname;
use cluuname::uname;
use cluuname::UtsName;

fn main() {
		let uname = uname().unwrap();

		let machine_all_hash = uname.uname_hash();
		let machive_version_hash = uname.version_hash();

		println!("UNAME_HASH {}", machine_all_hash);
		//12821596144084292007
		println!("UNAME_V_HASH {}", machive_version_hash);
		//2978006705337010168
}

CustomUname

#![feature(plugin)]
#![plugin(clucstr)]
extern crate cluuname;
use cluuname::build;

use std::ffi::CStr;

fn main() {
	let uname = build::custom(
		cstr!("Linux"),
		cstr!("cluComp"),
		cstr!("2.16-localhost"),
		cstr!("#1 SMP PREEMPT Sat Mar 31 23:59:18 UTC 2008"),
		cstr!("x86"),
	);
	println!("{}", uname);
	//"Linux" "cluComp" "2.16-localhost" "#1 SMP PREEMPT Sat Mar 31 23:59:18 UTC 2008" "x86"
}

Flags

enable_domainname - Additional item domainname

[dependencies] cluuname = { version = "*", features = ["enable_domainname"] }

License

Copyright 2018 #UlinProject Денис Котляров

Licensed under the Apache License, Version 2.0