From 6f2b73a294d929120f328edffc076fab919f87b0 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Fri, 13 Sep 2024 14:25:37 +0200 Subject: [PATCH] fix: Update ESP-IDF structs --- src/unix/newlib/generic.rs | 3 +++ src/unix/newlib/mod.rs | 23 ++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/unix/newlib/generic.rs b/src/unix/newlib/generic.rs index e45413a7a9e2c..d716dec19f0f8 100644 --- a/src/unix/newlib/generic.rs +++ b/src/unix/newlib/generic.rs @@ -2,7 +2,10 @@ s! { pub struct sigset_t { + #[cfg(target_os = "horizon")] __val: [::c_ulong; 16], + #[cfg(not(target_os = "horizon"))] + __val: u32, } pub struct stat { diff --git a/src/unix/newlib/mod.rs b/src/unix/newlib/mod.rs index 80748fb333680..b6d8b6ada2737 100644 --- a/src/unix/newlib/mod.rs +++ b/src/unix/newlib/mod.rs @@ -203,6 +203,10 @@ s! { pub c_lflag: ::tcflag_t, pub c_line: ::cc_t, pub c_cc: [::cc_t; ::NCCS], + #[cfg(target_os = "espidf")] + pub c_ispeed: u32, + #[cfg(target_os = "espidf")] + pub c_ospeed: u32, } pub struct sem_t { // Unverified @@ -230,7 +234,24 @@ s! { } pub struct pthread_attr_t { // Unverified - __size: [u8; __SIZEOF_PTHREAD_ATTR_T] + #[cfg(not(target_os = "espidf"))] + __size: [u8; __SIZEOF_PTHREAD_ATTR_T], + #[cfg(target_os = "espidf")] + pub is_initialized: i32, + #[cfg(target_os = "espidf")] + pub stackaddr: *mut crate::c_void, + #[cfg(target_os = "espidf")] + pub stacksize: i32, + #[cfg(target_os = "espidf")] + pub contentionscope: i32, + #[cfg(target_os = "espidf")] + pub inheritsched: i32, + #[cfg(target_os = "espidf")] + pub schedpolicy: i32, + #[cfg(target_os = "espidf")] + pub schedparam: i32, + #[cfg(target_os = "espidf")] + pub detachstate: i32, } pub struct pthread_rwlockattr_t { // Unverified