Skip to content

Commit 2ee94b7

Browse files
committed
gnu: Handle timeval.tv_usec for glibc 64-bit time_t
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 f5d6ac1 commit 2ee94b7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/unix/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ s! {
6262

6363
pub struct timeval {
6464
pub tv_sec: time_t,
65+
#[cfg(not(gnu_time64_abi))]
6566
pub tv_usec: suseconds_t,
67+
// For 64 bit time on 32 bit linux glibc, suseconds_t is still
68+
// a 32 bit type. Using suseconds_t here will break the tests, use i64 instead
69+
#[cfg(gnu_time64_abi)]
70+
pub tv_usec: i64
6671
}
6772

6873
// linux x32 compatibility

0 commit comments

Comments
 (0)