Skip to content

Commit e2418ec

Browse files
committed
linux: Handle timeval.tv_usec for linux __USE_TIME_BITS64
For 64 bit time on 32 bit linux glibc timeval.tv_usec is actually __suseconds64_t (64 bits) while suseconds_t is still 32 bits.
1 parent 778e5c9 commit e2418ec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/unix/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ s! {
6868

6969
pub struct timeval {
7070
pub tv_sec: time_t,
71+
#[cfg(not(linux_time_bits64))]
7172
pub tv_usec: suseconds_t,
73+
// For 64 bit time on 32 bit linux glibc, suseconds_t is still
74+
// a 32 bit type. Using suseconds_t here will break the tests, use i64 instead
75+
#[cfg(linux_time_bits64)]
76+
pub tv_usec: i64,
7277
}
7378

7479
// linux x32 compatibility

0 commit comments

Comments
 (0)