Skip to content

Fix timeval conversion for 32-bit glibc time64 builds - #686

Open
omrzk wants to merge 1 commit into
rust-lang:masterfrom
omrzk:fix/time64-timeval-684
Open

omrzk wants to merge 1 commit into
rust-lang:masterfrom
omrzk:fix/time64-timeval-684

Conversation

@omrzk

@omrzk omrzk commented Nov 6, 2026

Copy link
Copy Markdown

With libc's 64-bit time configuration on 32-bit glibc, timeval.tv_usec is 64-bit while suseconds_t remains 32-bit. Casting to the latter prevents socket2 from compiling. Infer the field's actual type instead, and check both i686 and armv7 time64 builds in CI.

Fixes #684.

Validation: the all-targets/all-features compile regression fails on current master for i686 and armv7 with --cfg=libc_unstable_time64, and passes with this change. Both targets and x86_64 also pass without the cfg; x86_64 passes with it. cargo test, cargo test --all-features in debug/release, formatting and strict Clippy pass locally. Cross targets were compile-checked, not executed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build fails on 32-bit glibc (i686, armv7) with libc's --cfg=libc_unstable_time64: tv_usec is cast to suseconds_t (i32) for an i64 field

1 participant