Skip to content

Commit e510449

Browse files
sylvestrecakebaker
authored andcommitted
cat: add WASI stub for is_unsafe_overwrite and add to feat_wasm
WASI has no fstat-based device/inode checks, so always return false (assume safe) for the overwrite detection.
1 parent f0c2324 commit e510449

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ feat_wasm = [
184184
"base32",
185185
"base64",
186186
"basenc",
187+
"cat",
187188
"cut",
188189
"ls",
189190
"date",

src/uu/cat/src/platform/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ pub use self::unix::is_unsafe_overwrite;
99
#[cfg(windows)]
1010
pub use self::windows::is_unsafe_overwrite;
1111

12+
// WASI: no fstat-based device/inode checks available; assume safe.
13+
#[cfg(target_os = "wasi")]
14+
pub fn is_unsafe_overwrite<I, O>(_input: &I, _output: &O) -> bool {
15+
false
16+
}
17+
1218
#[cfg(unix)]
1319
mod unix;
1420

0 commit comments

Comments
 (0)