summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 826ed838..1dcc71ee 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -43,7 +43,7 @@ pub mod unistd;
*
*/
-use libc::{c_char, PATH_MAX};
+use libc::c_char;
use std::{ptr, result};
use std::ffi::CStr;
use std::path::{Path, PathBuf};
@@ -52,6 +52,14 @@ use std::io;
use std::fmt;
use std::error;
+#[cfg(any(target_os = "openbsd", target_os = "netbsd", target_os = "bitrig", target_os = "macos", target_os = "ios"))]
+use libc::PATH_MAX;
+#[cfg(not(any(target_os = "openbsd", target_os = "netbsd", target_os = "bitrig", target_os = "macos", target_os = "ios")))]
+const PATH_MAX: c_int = 1024;
+
+
+
+
pub type Result<T> = result::Result<T, Error>;
#[derive(Clone, Copy, Debug, PartialEq)]