diff --git a/src/system/mod.rs b/src/system/mod.rs
index a8251b4d4..7061ccbcc 100644
--- a/src/system/mod.rs
+++ b/src/system/mod.rs
@@ -1,5 +1,7 @@
use core::fmt;
// TODO: remove unused attribute when system is cleaned up
+#[cfg(target_os = "linux")]
+use std::str::FromStr;
use std::{
collections::BTreeSet,
ffi::{c_uint, CStr, CString},
@@ -11,7 +13,6 @@ use std::{
unix::{self, prelude::OsStrExt},
},
path::{Path, PathBuf},
- str::FromStr,
};
use crate::{
@@ -562,6 +563,7 @@ pub enum WithProcess {
}
impl WithProcess {
+ #[cfg(target_os = "linux")]
fn to_proc_string(&self) -> String {
match self {
WithProcess::Current => "self".into(),
@@ -620,6 +622,7 @@ impl Process {
/// Returns the device identifier of the TTY device that is currently
/// attached to the given process
+ #[cfg(target_os = "linux")]
pub fn tty_device_id(pid: WithProcess) -> std::io::Result