Stream: wasi

Topic: Unclear things in the WASI spec


view this post on Zulip Dag Ågren (Mar 07 2021 at 19:43):

I'm doing a minimal WASI implementation for internal use, and noticing a few things in the spec that are unclear.

view this post on Zulip Dag Ågren (Mar 07 2021 at 19:44):

The current one I am struggling with is fd_prestat_dir_name. I assume it returns a C-style 0-terminated string? That should be made clear if so.

view this post on Zulip Dag Ågren (Mar 07 2021 at 19:45):

Also, what happens if the buffer you pass in is too short for the name?

view this post on Zulip Dan Gohman (Mar 08 2021 at 15:35):

Yeah; this is an area we've not polished a lot, because we expect to switch it to interface types, where we can just say it returns a string

view this post on Zulip Dan Gohman (Mar 08 2021 at 15:37):

It does not return a NUL-terminated string; the length of the string is the pr_name_len field from the prestat_get call

view this post on Zulip Dan Gohman (Mar 08 2021 at 15:38):

If the buffer is too small, I think it's an inval error, iirc.


Last updated: Nov 22 2024 at 16:03 UTC