Function sysctl::set_value

source ·
pub fn set_value(name: &str, value: CtlValue) -> Result<CtlValue, SysctlError>
Expand description

Sets the value of a sysctl. Fetches and returns the new value if successful, or a SysctlError on failure

Example

extern crate sysctl;

fn main() {
    let new_value = sysctl::set_value("hw.usb.debug", sysctl::CtlValue::Int(1))
        .expect("could not set sysctl value");
    assert_eq!(new_value, sysctl::CtlValue::Int(1));
}