Skip to content

Commit 6d98dc2

Browse files
committed
Update struct timespec for _TIME_BITS=64
powerpc and mips wants 32 bits of padding before tv_nsec. arm and x86 wants 32bits of padding after tv_nsec.
1 parent 2f35401 commit 6d98dc2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/unix/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,17 @@ s! {
7878
// See https://sourceware.org/bugzilla/show_bug.cgi?id=16437
7979
pub struct timespec {
8080
pub tv_sec: time_t,
81+
82+
#[cfg(all(target_env = "gnu", any(target_arch = "powerpc", target_arch = "mips"), target_pointer_width = "32"))]
83+
__pad: i32,
84+
8185
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
8286
pub tv_nsec: i64,
8387
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
8488
pub tv_nsec: ::c_long,
89+
90+
#[cfg(all(target_env = "gnu", any(target_arch = "x86", target_arch = "arm"), target_pointer_width = "32"))]
91+
__pad: i32,
8592
}
8693

8794
pub struct rlimit {

0 commit comments

Comments
 (0)