Skip to content

Commit

Permalink
enable sysinfo support on illumos systems
Browse files Browse the repository at this point in the history
Support for illumos systems was added to the sys-info crate some time
ago, and was working with effective-limits, but as of 887a5a0
appears to have effectively been turned off at build time.
  • Loading branch information
jclulow committed Jan 22, 2021
1 parent 1839f22 commit b610a99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -160,6 +162,8 @@ pub fn memory_limit() -> Result<u64> {
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;
Expand Down

0 comments on commit b610a99

Please sign in to comment.