nix::kmod

Function finit_module

Source
pub fn finit_module<T: AsRawFd>(
    fd: &T,
    param_values: &CStr,
    flags: ModuleInitFlags,
) -> Result<()>
Expand description

Loads a kernel module from a given file descriptor.

ยงExample

use std::fs::File;
use std::ffi::CString;
use nix::kmod::{finit_module, ModuleInitFlags};

let f = File::open("mymod.ko").unwrap();
finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()).unwrap();

See man init_module(2) for more information.