xia-chao opened PR #14520 from xia-chao:wasi-write-permit-complete to bytecodealliance:main:
A stream has to trap when you write more than
check-writeallowed. Three don't:
SinkOutputStream— a guest's stdout with-Sinherit-stdout=nOutputFileCustomOutputStreamThey hand back a number and then take anything. All three always give the same number, so one
check is enough. Spec: io.wit.
xia-chao requested pchickey for a review on PR #14520.
xia-chao requested wasmtime-wasi-reviewers for a review on PR #14520.
xia-chao requested wasmtime-core-reviewers for a review on PR #14520.
xia-chao edited PR #14520:
A stream has to trap when you write more than
check-writeallowed. Three don't:SinkOutputStream — a guest's stdout with
-Sinherit-stdout=n:
https://github.com/.../crates/wasi/src/p2/pipe.rs#L277-L290OutputFile:
https://github.com/.../crates/wasi/src/cli/file.rs#L49-L65CustomOutputStream:
https://github.com/.../crates/c-api/src/wasi.rs#L212-L233They hand back a number and then take anything. All three always give the same number, so one check is enough.
Spec:
https://github.com/.../crates/wasi-io/wit/deps/io.wit#L184-L204
xia-chao edited PR #14520:
A stream has to trap when you write more than
check-writeallowed. Three don't:SinkOutputStream — a guest's stdout with
-Sinherit-stdout=n:
https://github.com/bytecodealliance/wasmtime/blob/4b3cef0268cf52a079e07f1d39327121c13561a2/crates/wasi/src/p2/pipe.rs#L277-L290CustomOutputStream:
https://github.com/bytecodealliance/wasmtime/blob/4b3cef0268cf52a079e07f1d39327121c13561a2/crates/c-api/src/wasi.rs#L212-L233They hand back a number and then take anything. All three always give the same number, so one check is enough.
xia-chao updated PR #14520.
xia-chao updated PR #14520.
github-actions[bot] added the label wasi on PR #14520.
github-actions[bot] added the label wasmtime:c-api on PR #14520.
:cross_mark: xia-chao closed without merge PR #14520.
Last updated: Oct 11 2026 at 04:10 UTC