Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update use of libc::timespec to prepare for future libc version #909

Merged

Conversation

wesleywiser
Copy link
Contributor

In a future release of the libc crate, libc::timespec will contain private padding fields on *-linux-musl targets and so the struct will no longer be able to be created using the literal initialization syntax.

Update the use of libc::timespec to create a value by calling std::mem::zeroed() which works with both current versions of libc as well as the future version which contains that change.

See also rust-lang/libc#2088

In a future release of the `libc` crate, `libc::timespec` will contain
private padding fields on `*-linux-musl` targets and so the struct will
no longer be able to be created using the literal initialization syntax.

Update the use of `libc::timespec` to create a value by calling
`std::mem::zeroed()` which works with both current versions of `libc`
as well as the future version which contains that change.
@GuillaumeGomez
Copy link
Owner

Nice, thanks!

@GuillaumeGomez GuillaumeGomez merged commit 3d87322 into GuillaumeGomez:master Jan 10, 2023
@wesleywiser
Copy link
Contributor Author

Thanks for the quick turnaround! 😃

I've been doing crater runs of the proposed libc changes and found a number of crates which depend on sysinfo-0.26.8. Would you be willing to take a backport of this change to 0.26 and release a 0.26.9 version with that change?

@GuillaumeGomez
Copy link
Owner

Sure, I'll do it in a few hours then.

@wesleywiser
Copy link
Contributor Author

Thanks so much! I'll post a PR shortly after I backport and validate the change.

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.

2 participants