bumblebee/src/renice.rs

10 lines
274 B
Rust

use std::error::Error;
use std::process::Command;
pub fn renice(pid: u32, niceness: u8) -> Result<(), Box<dyn Error>> {
let mut command = Command::new("renice");
command.arg(niceness.to_string());
command.arg(pid.to_string());
command.spawn()?;
Ok(())
}