Function try_load

Source
pub fn try_load(module: &CStr)
Expand description

Try to load a host kernel module via the modprobe userspace helper.

This triggers a modprobe execution in the host namespace. Caller must have the CAP_SYS_MODULE capability in order to load a module. There is no way to know if the module has been properly loaded, as the kernel does not return such information.

Examples found in repository?
examples/load.rs (line 8)
6fn main() {
7    let modname = env::args().nth(1).expect("missing module name");
8    modinsert::try_load(&CString::new(modname).unwrap());
9}