uucore/fsext: fix unused imports and split read_fs_list for wasm target

This commit is contained in:
Sylvestre Ledru
2026-04-03 12:15:40 +02:00
parent c515cf2d19
commit 409eb11d75
+9 -1
View File
@@ -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<Vec<MountInfo>> {
#[cfg(any(target_os = "linux", target_os = "android", target_os = "cygwin"))]
{
@@ -538,7 +540,6 @@ pub fn read_fs_list() -> UResult<Vec<MountInfo>> {
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<Vec<MountInfo>> {
}
}
/// Read file system list.
#[cfg(target_os = "wasi")]
pub fn read_fs_list() -> Vec<MountInfo> {
// No method to read mounts on WASI
Vec::new()
}
#[derive(Debug, Clone)]
pub struct FsUsage {
pub blocksize: u64,