How is lseek implemented? I can see it goes to __wasi_fd_seek but it seems to allow seeking for files under /sys which seems odd
In wasmtime I suppose I should be looking
In wasmtime it goes through cap-std's seek, which calls into Rust's standard library seek, which is just a call to the OS lseek
That should be ok then, hmm pwrite it returning -1 for bytes written with an offset of 1.
I'll knock up some plain c to see if that works
ok, well c is the same unsurprisingly. I'm no expert and nothing to do with wasm, but if lseek allows seeking to an offset, I'd have though pwrite would be ok with it.
Scott Waye has marked this topic as resolved.
Shameless self plug, WASI SDK on the Raspberry PI: https://twitter.com/yowl00/status/1491584897613541382
Using C# #dotnet and #WebAssembly with the WASI SDK to control the GPIO on a #RaspberryPi PRs incoming to enable this from `dotnet publish` with NativeAOT-LLVM (https://github.com/dotnet/runtimelab/tree/feature/NativeAOT-LLVM) https://twitter.com/yowl00/status/1491584897613541382/video/1
- Scott Waye (@yowl00)Last updated: Dec 23 2024 at 13:07 UTC