Skip to content
/ kmod-rs Public

Bindings to libkmod to manage linux kernel modules

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

kpcyrd/kmod-rs

Repository files navigation

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

About

Bindings to libkmod to manage linux kernel modules

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published