Stream: wasm

Topic: ✔ wasi lseek


view this post on Zulip Scott Waye (Feb 10 2022 at 00:34):

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

view this post on Zulip Scott Waye (Feb 10 2022 at 00:37):

In wasmtime I suppose I should be looking

view this post on Zulip Dan Gohman (Feb 10 2022 at 00:38):

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

view this post on Zulip Scott Waye (Feb 10 2022 at 00:40):

That should be ok then, hmm pwrite it returning -1 for bytes written with an offset of 1.

view this post on Zulip Scott Waye (Feb 10 2022 at 00:40):

I'll knock up some plain c to see if that works

view this post on Zulip Scott Waye (Feb 10 2022 at 01:03):

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.

view this post on Zulip Notification Bot (Feb 10 2022 at 01:03):

Scott Waye has marked this topic as resolved.

view this post on Zulip Scott Waye (Feb 10 2022 at 01:30):

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: Nov 22 2024 at 17:03 UTC