Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 63 additions & 71 deletions src/teeos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,89 +61,81 @@ pub type wctype_t = c_ulong;

pub type cmpfunc = extern "C" fn(x: *const c_void, y: *const c_void) -> c_int;

#[repr(align(16))]
pub struct _CLongDouble(pub u128);

#[repr(align(8))]
#[repr(C)]
pub struct pthread_cond_t {
#[doc(hidden)]
size: [u8; __SIZEOF_PTHREAD_COND_T],
s_paren! {
#[repr(align(16))]
pub struct _CLongDouble(pub u128);
}

#[repr(align(8))]
#[repr(C)]
pub struct pthread_mutex_t {
#[doc(hidden)]
size: [u8; __SIZEOF_PTHREAD_MUTEX_T],
}
s! {
#[repr(align(8))]
pub struct pthread_cond_t {
#[doc(hidden)]
size: [u8; __SIZEOF_PTHREAD_COND_T],
}

#[repr(align(4))]
#[repr(C)]
pub struct pthread_mutexattr_t {
#[doc(hidden)]
size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T],
}
#[repr(align(8))]
pub struct pthread_mutex_t {
#[doc(hidden)]
size: [u8; __SIZEOF_PTHREAD_MUTEX_T],
}

#[repr(align(4))]
#[repr(C)]
pub struct pthread_condattr_t {
#[doc(hidden)]
size: [u8; __SIZEOF_PTHREAD_CONDATTR_T],
}
#[repr(align(4))]
pub struct pthread_mutexattr_t {
#[doc(hidden)]
size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T],
}

#[repr(C)]
pub struct pthread_attr_t {
__size: [u64; 7],
}
#[repr(align(4))]
pub struct pthread_condattr_t {
#[doc(hidden)]
size: [u8; __SIZEOF_PTHREAD_CONDATTR_T],
}

#[repr(C)]
pub struct cpu_set_t {
bits: [c_ulong; 128 / size_of::<c_ulong>()],
}
pub struct pthread_attr_t {
__size: [u64; 7],
}

#[repr(C)]
pub struct timespec {
pub tv_sec: time_t,
pub tv_nsec: c_long,
}
pub struct cpu_set_t {
bits: [c_ulong; 128 / size_of::<c_ulong>()],
}

#[repr(C)]
pub struct timeval {
pub tv_sec: time_t,
pub tv_usec: suseconds_t,
}
pub struct timespec {
pub tv_sec: time_t,
pub tv_nsec: c_long,
}

#[repr(C)]
pub struct tm {
pub tm_sec: c_int,
pub tm_min: c_int,
pub tm_hour: c_int,
pub tm_mday: c_int,
pub tm_mon: c_int,
pub tm_year: c_int,
pub tm_wday: c_int,
pub tm_yday: c_int,
pub tm_isdst: c_int,
pub __tm_gmtoff: c_long,
pub __tm_zone: *const c_char,
}
pub struct timeval {
pub tv_sec: time_t,
pub tv_usec: suseconds_t,
}

#[repr(C)]
pub struct mbstate_t {
pub __opaque1: c_uint,
pub __opaque2: c_uint,
}
pub struct tm {
pub tm_sec: c_int,
pub tm_min: c_int,
pub tm_hour: c_int,
pub tm_mday: c_int,
pub tm_mon: c_int,
pub tm_year: c_int,
pub tm_wday: c_int,
pub tm_yday: c_int,
pub tm_isdst: c_int,
pub __tm_gmtoff: c_long,
pub __tm_zone: *const c_char,
}

#[repr(C)]
pub struct sem_t {
pub __val: [c_int; 4 * size_of::<c_long>() / size_of::<c_int>()],
}
pub struct mbstate_t {
pub __opaque1: c_uint,
pub __opaque2: c_uint,
}

#[repr(C)]
pub struct div_t {
pub quot: c_int,
pub rem: c_int,
pub struct sem_t {
pub __val: [c_int; 4 * size_of::<c_long>() / size_of::<c_int>()],
}

pub struct div_t {
pub quot: c_int,
pub rem: c_int,
}
}

// fcntl
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/musl/b64/wasm32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ pub const TOSTOP: crate::tcflag_t = 0x00000100;
pub const FLUSHO: crate::tcflag_t = 0x00001000;

cfg_if! {
if #[cfg(target_vendor = "wali")] {
if #[cfg(all(target_family = "wasm", target_env = "musl"))] {
mod wali;
pub use self::wali::*;
}
Expand Down
Loading
Loading