Function version

Source
pub fn version() -> Result<Version, String>
Expand description

Return a Result with a SemVer representation of the running Linux Kernel version.

Examples found in repository?
examples/simple.rs (line 13)
9fn main() {
10
11    println!("[+] Checking Linux kernel version...");
12
13    let ver = linuxver::version().unwrap();
14
15    println!("[+] System is running Linux kernel: {}.{}.{}", ver.major, ver.minor, ver.patch);
16
17    if ver >= Version::parse(SECCOMP_MIN_KERNEL_VERSION).unwrap() {
18        println!("[+] Your kernel version should support SECCOMP.");
19    } else {
20        println!("[+] Your kernel version does not support SECCOMP");
21    };
22
23
24}