From 2d1d9e136963025339eff6f318cb2e8a28c0998a Mon Sep 17 00:00:00 2001 From: omrzk <193513049+omrzk@users.noreply.github.com> Date: Fri, 6 Nov 2026 09:06:41 -0600 Subject: [PATCH] Fix timeval conversion with 64-bit time on 32-bit glibc --- .github/workflows/main.yml | 15 +++++++++++++++ src/sys/unix.rs | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dcb329a8..9c760601 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -125,6 +125,21 @@ jobs: run: cargo hack check -Z build-std=std,panic_abort --feature-powerset --target ${{ matrix.target }} - name: Check docs run: RUSTDOCFLAGS="-D warnings --cfg docsrs" cargo doc -Z build-std=std,panic_abort --no-deps --all-features --target ${{ matrix.target }} + CheckTime64: + name: Check 64-bit time (${{ matrix.target }}) + runs-on: ubuntu-latest + strategy: + matrix: + target: [i686-unknown-linux-gnu, armv7-unknown-linux-gnueabihf] + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + - name: Check build with 64-bit time + env: + RUSTFLAGS: --cfg=libc_unstable_time64 + run: cargo check --all-targets --all-features --target ${{ matrix.target }} Clippy: name: Clippy runs-on: ubuntu-latest diff --git a/src/sys/unix.rs b/src/sys/unix.rs index 8027d325..7886a77a 100644 --- a/src/sys/unix.rs +++ b/src/sys/unix.rs @@ -1315,7 +1315,7 @@ fn into_timeval(duration: Option) -> libc::timeval { #[cfg_attr(target_env = "musl", allow(deprecated))] Some(duration) => libc::timeval { tv_sec: min(duration.as_secs(), libc::time_t::MAX as u64) as libc::time_t, - tv_usec: duration.subsec_micros() as libc::suseconds_t, + tv_usec: duration.subsec_micros() as _, }, None => libc::timeval { tv_sec: 0,