kmod

Crates.iokmod
lib.rskmod
version0.5.0
sourcesrc
created_at2018-03-05 15:11:17.487306
updated_at2022-12-06 12:16:15.736978
descriptionBindings to libkmod to manage linux kernel modules
homepage
repositoryhttps://github.com/kpcyrd/kmod-rs
max_upload_size
id53958
size42,569
(kpcyrd)

documentation

README

kmod-rs Build Status crates.io docs.rs

Bindings to libkmod to manage linux kernel modules.

# Cargo.toml
[dependencies]
kmod = "0.4"

To get started, see the docs and the examples/ folder.

extern crate kmod;
extern crate env_logger;

fn main() {
    env_logger::init();

    let ctx = kmod::Context::new().expect("kmod ctx failed");

    for module in ctx.modules_loaded().unwrap() {
        let name = module.name();
        let refcount = module.refcount();
        let size = module.size();

        let holders: Vec<_> = module.holders()
                                .map(|x| x.name().to_owned())
                                .collect();

        println!("{:<19} {:8}  {} {:?}", name, size, refcount, holders);
    }
}

License

MIT/Apache-2.0

Commit count: 56

cargo fmt