(name: &str, target_value: i64)
| 19 | |
| 20 | #[cfg(target_os = "linux")] |
| 21 | fn ensure_sysctl(name: &str, target_value: i64) -> Result<()> { |
| 22 | if sysctl_read(name)? == target_value { |
| 23 | return Ok(()); |
| 24 | } |
| 25 | |
| 26 | let assignment = format!("{name}={target_value}"); |
| 27 | run_with_sudo("sysctl", ["-w", assignment.as_str()]) |
| 28 | } |
| 29 | |
| 30 | #[cfg(target_os = "linux")] |
| 31 | fn sysctl_read(name: &str) -> Result<i64> { |
no test coverage detected