WebAssembly / wasi-testsuite

WASI Testsuite
Apache License 2.0
53 stars 21 forks source link

Add test for pwrite with append flag #95

Closed yagehu closed 11 months ago

yagehu commented 11 months ago

WASI specifies fd_pwrite to be similar to POSIX pwritev which specifies that it should ignore the append flag and write from the supplied offset. Currently, only Wasmtime implements this behavior.

NB: There is a documented Linux bug that pwrite does not respect the offset and instead appends. Wasmtime fixes this by tracking the append flag status and hiding it from the OS.

yagehu commented 11 months ago

I've filed an issue with the WasmEdge team. They have expressed desire to bring WasmEdge behavior in line with Wasmtime and add this test case.

loganek commented 11 months ago

Thanks, the test looks reasonable. Could you please fix formatting problems reported by the build?

yagehu commented 11 months ago

@loganek Thanks! Fixed format.