diff --git a/Cargo.toml b/Cargo.toml index af5e76e..d4ecd19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,4 +50,6 @@ dirs-next = "2.0" [target."cfg(unix)".dependencies] termios = "0.3" + +[target.'cfg(target_os="linux")'.dependencies] rlimit = "0.5" diff --git a/src/lib.rs b/src/lib.rs index 5a1c0f0..92b528f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,6 +17,6 @@ pub mod runtime; pub mod scheduler; pub mod sockets; pub mod structs; -#[cfg(unix)] +#[cfg(target_os="linux")] pub mod ulimit; pub mod utils; diff --git a/src/main.rs b/src/main.rs index 5c8bf3a..0fd4b06 100644 --- a/src/main.rs +++ b/src/main.rs @@ -171,7 +171,7 @@ fn main() -> Result<()> { } let config = Arc::new(Config::load()?); - #[cfg(unix)] + #[cfg(target_os="linux")] badtouch::ulimit::set_nofile(&config) .context("Failed to set RLIMIT_NOFILE")?;