Skip to content

Commit 016e498

Browse files
SergioGasqueztgross35
authored andcommitted
fix: Update ESP-IDF structs
(backport <rust-lang#3920>) (cherry picked from commit 6f2b73a)
1 parent 8ec2594 commit 016e498

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/unix/newlib/generic.rs

+3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
33
s! {
44
pub struct sigset_t {
5+
#[cfg(target_os = "horizon")]
56
__val: [::c_ulong; 16],
7+
#[cfg(not(target_os = "horizon"))]
8+
__val: u32,
69
}
710

811
pub struct stat {

src/unix/newlib/mod.rs

+22-1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ s! {
203203
pub c_lflag: ::tcflag_t,
204204
pub c_line: ::cc_t,
205205
pub c_cc: [::cc_t; ::NCCS],
206+
#[cfg(target_os = "espidf")]
207+
pub c_ispeed: u32,
208+
#[cfg(target_os = "espidf")]
209+
pub c_ospeed: u32,
206210
}
207211

208212
pub struct sem_t { // Unverified
@@ -230,7 +234,24 @@ s! {
230234
}
231235

232236
pub struct pthread_attr_t { // Unverified
233-
__size: [u8; __SIZEOF_PTHREAD_ATTR_T]
237+
#[cfg(not(target_os = "espidf"))]
238+
__size: [u8; __SIZEOF_PTHREAD_ATTR_T],
239+
#[cfg(target_os = "espidf")]
240+
pub is_initialized: i32,
241+
#[cfg(target_os = "espidf")]
242+
pub stackaddr: *mut crate::c_void,
243+
#[cfg(target_os = "espidf")]
244+
pub stacksize: i32,
245+
#[cfg(target_os = "espidf")]
246+
pub contentionscope: i32,
247+
#[cfg(target_os = "espidf")]
248+
pub inheritsched: i32,
249+
#[cfg(target_os = "espidf")]
250+
pub schedpolicy: i32,
251+
#[cfg(target_os = "espidf")]
252+
pub schedparam: i32,
253+
#[cfg(target_os = "espidf")]
254+
pub detachstate: i32,
234255
}
235256

236257
pub struct pthread_rwlockattr_t { // Unverified

0 commit comments

Comments
 (0)