diff --git a/src/uucore/src/lib/features/fsext.rs b/src/uucore/src/lib/features/fsext.rs index b118cea1f..0ede0f287 100644 --- a/src/uucore/src/lib/features/fsext.rs +++ b/src/uucore/src/lib/features/fsext.rs @@ -428,6 +428,7 @@ fn mount_dev_id(mount_dir: &OsStr) -> String { } } +#[cfg(not(target_os = "wasi"))] use crate::error::UResult; #[cfg(any( target_os = "freebsd", @@ -458,6 +459,7 @@ use std::ptr; use std::slice; /// Read file system list. +#[cfg(not(target_os = "wasi"))] pub fn read_fs_list() -> UResult> { #[cfg(any(target_os = "linux", target_os = "android", target_os = "cygwin"))] { @@ -538,7 +540,6 @@ pub fn read_fs_list() -> UResult> { target_os = "redox", target_os = "illumos", target_os = "solaris", - target_os = "wasi" ))] { // No method to read mounts on these platforms @@ -546,6 +547,13 @@ pub fn read_fs_list() -> UResult> { } } +/// Read file system list. +#[cfg(target_os = "wasi")] +pub fn read_fs_list() -> Vec { + // No method to read mounts on WASI + Vec::new() +} + #[derive(Debug, Clone)] pub struct FsUsage { pub blocksize: u64,