Skip to content

Commit

Permalink
fix: Update ESP-IDF structs
Browse files Browse the repository at this point in the history
(backport <rust-lang#3920>)
(cherry picked from commit 6f2b73a)
  • Loading branch information
SergioGasquez authored and tgross35 committed Oct 15, 2024
1 parent 8ec2594 commit 016e498
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/unix/newlib/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
23 changes: 22 additions & 1 deletion src/unix/newlib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 016e498

Please sign in to comment.