-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-threadArea: `std::thread`Area: `std::thread`O-wasiOperating system: Wasi, Webassembly System InterfaceOperating system: Wasi, Webassembly System InterfaceT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
rust/library/std/src/sys/wasi/thread.rs
Lines 19 to 26 in 5697f16
// defined in wasi-libc | |
// https://github.com/WebAssembly/wasi-libc/blob/a6f871343313220b76009827ed0153586361c0d5/libc-top-half/musl/include/alltypes.h.in#L108 | |
#[repr(C)] | |
union pthread_attr_union { | |
__i: [ffi::c_int; if mem::size_of::<ffi::c_int>() == 8 { 14 } else { 9 }], | |
__vi: [ffi::c_int; if mem::size_of::<ffi::c_int>() == 8 { 14 } else { 9 }], | |
__s: [ffi::c_ulong; if mem::size_of::<ffi::c_int>() == 8 { 7 } else { 9 }], | |
} |
the type which should have its size compared is c_long
, not c_int
:
wasi-libc's code linked in comment above:
TYPEDEF struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
since you made the commit, cc @g0djan
Metadata
Metadata
Assignees
Labels
A-threadArea: `std::thread`Area: `std::thread`O-wasiOperating system: Wasi, Webassembly System InterfaceOperating system: Wasi, Webassembly System InterfaceT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.