Closed Userzxcvbvnm closed 5 months ago
Wasmtime has chosen not to support (return ERRNO_NOTSUP
) the fd_allocate
import function in Wasi 0.1, because it is not possible to implement that function on all of the common OSs. That function was removed from the Wasi 0.2 spec accordingly. See https://github.com/bytecodealliance/wasmtime/pull/6217 and numerous other issues which refer to this.
Thanks for your reply !
Test Case
The c test case is:
Steps to Reproduce
(1)compile to wasm:
./wasi-sdk-21.0/bin/clang --target=wasm32-unkown-wasi --sysroot=./wasi-sdk-21.0/share/wasi-sysroot test.c -o test.wasm
(2)Running wasm: (Before run the Wasm file, file subdir_2/subdir_1/subdir_5/subfile_1 exists, and file size is 62.)
wasmtime run --dir=. test.wasm
Expected Results
Print:
This is what WAMR and WasmEdge do. First the file is trunced due to the "O_TRUNC" openstyle, and the file size is 0 as printed. Then, 4 bytes are allocated, and the files size change into 4 bytes.
Actual Results
wasmtime prints:
wasmtime fail to allocate space.
Versions and Environment
Wasmtime version or commit: 19.0.2 Operating system: Ubuntu 20.04 Architecture: x86_64