From b610a996c2a1f195eb60b8931fc77e4488b3a0a7 Mon Sep 17 00:00:00 2001 From: "Joshua M. Clulow" Date: Mon, 14 Dec 2020 14:58:47 -0800 Subject: [PATCH] enable sysinfo support on illumos systems Support for illumos systems was added to the sys-info crate some time ago, and was working with effective-limits, but as of 887a5a06f62 appears to have effectively been turned off at build time. --- Cargo.toml | 2 +- src/lib.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 7bc8598..d954d52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ license = "Apache-2.0" cfg-if="0.1.10" thiserror = "1.0.20" -[target.'cfg(any(windows, target_os="macos", target_os="linux", target_os="freebsd"))'.dependencies] +[target.'cfg(any(windows, target_os="macos", target_os="linux", target_os="freebsd", target_os="illumos", target_os="solaris"))'.dependencies] sys-info = "0.7.0" [target.'cfg(unix)'.dependencies] diff --git a/src/lib.rs b/src/lib.rs index 4eba22e..0f1bc9a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,6 +11,8 @@ cfg_if! { target_os="macos", target_os="linux", target_os="freebsd", + target_os="illumos", + target_os="solaris", ))] { #[derive(thiserror::Error, Debug)] pub enum Error { @@ -160,6 +162,8 @@ pub fn memory_limit() -> Result { target_os="macos", target_os="linux", target_os="freebsd", + target_os="illumos", + target_os="solaris", ))] { let info = sys_info::mem_info()?; let total_ram = info.total * 1024;