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

Statfs fs MAGIC constants are not available for target_os = "android" #1689

Closed
flxo opened this issue Mar 24, 2022 · 2 comments · Fixed by #1690
Closed

Statfs fs MAGIC constants are not available for target_os = "android" #1689

flxo opened this issue Mar 24, 2022 · 2 comments · Fixed by #1690

Comments

@flxo
Copy link
Contributor

flxo commented Mar 24, 2022

The fs type constants defined in src/sys/statfs are guard by #[cfg(all(target_os = "linux", not(target_env = "musl")))] and therefore not available for target_os = "android. That hit me while patching cgroups-rs for Android and adding the target_os = "android" guard here

Any change to get this updated to #[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]?
If yes I can prepare a PR.

Thanks!

@asomers
Copy link
Member

asomers commented Mar 24, 2022

It depends. Are those constants actually defined on Android? If they are, are they defined in rust's libc? If the answer to the first question is "no", then there's nothing for you to do. If yes, but the answer to the second question is no, then you should submit a PR to https://github.com/rust-lang/libc first, and to Nix second. If the answer to both questions is yes, then feel free to submit a PR.

@flxo
Copy link
Contributor Author

flxo commented Mar 25, 2022

Thanks @asomers. Looks like the constants are enabled in libc for target_os = "android" here.

I'll send a PR with the updated guards. I will also sync the constants - looks like there are more in libc than in nix.

bors bot added a commit that referenced this issue Apr 7, 2022
1690: Enable statfs magic constants for target_os = "android" r=rtzoeller a=flxo

The statfs magic constants of file systems types are available on
target_os android and the cfg guard is updated accordingly.

Sync the list of constant with the constants declared in libc.

Fixes #1689

Co-authored-by: Felix Obenhuber <[email protected]>
@bors bors bot closed this as completed in 42f671b Apr 7, 2022
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 a pull request may close this issue.

2 participants