From 919600d10bb4e0d049e32ce88cd6aa3ab6628a4d Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 12 Dec 2020 05:57:25 +0000 Subject: [PATCH] Stub out the utimesat emulation logic on Android. Android always has `utimensat` available, so it is not necessary (or possible, for that matter) to emulate it. Mark the fallback path as `unreachable!()`. --- crates/wasi-common/yanix/src/sys/linux/filetime.rs | 5 ++++- crates/wasi-common/yanix/src/sys/linux/mod.rs | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/wasi-common/yanix/src/sys/linux/filetime.rs b/crates/wasi-common/yanix/src/sys/linux/filetime.rs index 3c4cdfa9f6..34faefc6d6 100644 --- a/crates/wasi-common/yanix/src/sys/linux/filetime.rs +++ b/crates/wasi-common/yanix/src/sys/linux/filetime.rs @@ -53,5 +53,8 @@ pub fn utimensat( return Err(err); } - super::utimesat::utimesat(dirfd, path, atime, mtime, symlink_nofollow) + #[cfg(not(target_os = "android"))] + return super::utimesat::utimesat(dirfd, path, atime, mtime, symlink_nofollow); + #[cfg(target_os = "android")] + unreachable!(); } diff --git a/crates/wasi-common/yanix/src/sys/linux/mod.rs b/crates/wasi-common/yanix/src/sys/linux/mod.rs index 26432d36dd..37d8a0a8af 100644 --- a/crates/wasi-common/yanix/src/sys/linux/mod.rs +++ b/crates/wasi-common/yanix/src/sys/linux/mod.rs @@ -2,4 +2,5 @@ pub(crate) mod dir; pub(crate) mod fadvise; pub(crate) mod file; pub(crate) mod filetime; +#[cfg(not(target_os = "android"))] pub(crate) mod utimesat;