devela::_dep::nc::call

Function reboot

pub unsafe fn reboot(
    magic: i32,
    magci2: i32,
    cmd: u32,
    arg: usize,
) -> Result<(), i32> 
Available on crate feature dep_nc only.
Expand description

Reboot or enable/disable Ctrl-Alt-Del.

§Examples

let ret = unsafe {
    nc::reboot(
        nc::LINUX_REBOOT_MAGIC1,
        nc::LINUX_REBOOT_MAGIC2,
        nc::LINUX_REBOOT_CMD_RESTART,
        0
    )
};
assert!(ret.is_err());
assert_eq!(ret, Err(nc::EPERM));