-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid calling
openat2
on Android in more places. (#316)
Disable the `openat2` code entirely on Android with a `cfg`, and adjust other code to avoid calling it. This fixes some `openat2` calls that remained after #312.
- Loading branch information
1 parent
1317c28
commit ada5272
Showing
3 changed files
with
29 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,37 @@ | ||
#[cfg(target_os = "linux")] | ||
mod canonicalize_impl; | ||
#[cfg(target_os = "linux")] | ||
mod file_metadata; | ||
mod file_path; | ||
#[cfg(target_os = "linux")] | ||
mod open_entry_impl; | ||
mod open_impl; | ||
mod procfs; | ||
mod set_permissions_impl; | ||
mod set_times_impl; | ||
#[cfg(target_os = "linux")] | ||
mod stat_impl; | ||
|
||
#[cfg(target_os = "android")] | ||
pub(crate) use crate::fs::manually::canonicalize as canonicalize_impl; | ||
#[cfg(target_os = "android")] | ||
pub(crate) use crate::fs::manually::open_entry as open_entry_impl; | ||
#[cfg(target_os = "android")] | ||
pub(crate) use crate::fs::manually::stat as stat_impl; | ||
pub(crate) use crate::fs::via_parent::set_times_nofollow as set_times_nofollow_impl; | ||
#[cfg(target_os = "linux")] | ||
pub(crate) use canonicalize_impl::canonicalize_impl; | ||
pub(crate) use file_path::file_path; | ||
#[cfg(target_os = "linux")] | ||
pub(crate) use open_entry_impl::open_entry_impl; | ||
pub(crate) use open_impl::{open_beneath, open_impl}; | ||
#[cfg(target_os = "linux")] | ||
pub(crate) use open_impl::open_beneath; | ||
pub(crate) use open_impl::open_impl; | ||
pub(crate) use set_permissions_impl::set_permissions_impl; | ||
pub(crate) use set_times_impl::set_times_impl; | ||
#[cfg(target_os = "linux")] | ||
pub(crate) use stat_impl::stat_impl; | ||
|
||
use file_metadata::file_metadata; | ||
|
||
// In theory we could optimize `link` using `openat2` with `O_PATH` and | ||
// `linkat` with `AT_EMPTY_PATH`, however that requires `CAP_DAC_READ_SEARCH`, | ||
// so it isn't very widely applicable. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters