diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 79c3ef8be222..46b356a9e800 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -252,7 +252,11 @@ pub const SIG_IGN: sighandler_t = 1 as sighandler_t; pub const SIG_ERR: sighandler_t = !0 as sighandler_t; cfg_if! { - if #[cfg(all(not(target_os = "nto"), not(target_os = "aix")))] { + if #[cfg(all( + not(target_os = "nto"), + not(target_os = "aix"), + not(target_os = "espidf") + ))] { pub const DT_UNKNOWN: u8 = 0; pub const DT_FIFO: u8 = 1; pub const DT_CHR: u8 = 2; diff --git a/src/unix/newlib/espidf/mod.rs b/src/unix/newlib/espidf/mod.rs index d3b01b883566..b791bbe26536 100644 --- a/src/unix/newlib/espidf/mod.rs +++ b/src/unix/newlib/espidf/mod.rs @@ -99,6 +99,17 @@ pub const NSIG: size_t = 32; pub const SOMAXCONN: c_int = 128; +pub const DT_UNKNOWN: u8 = 0; +pub const DT_REG: u8 = 1; +pub const DT_DIR: u8 = 2; +// Not used by esp-idf, but still defined in headers. +pub const DT_CHR: u8 = 4; +pub const DT_BLK: u8 = 6; +pub const DT_FIFO: u8 = 8; +pub const DT_LNK: u8 = 10; +pub const DT_SOCK: u8 = 12; +pub const DT_WHT: u8 = 14; + extern "C" { pub fn pthread_create( native: *mut crate::pthread_t,