wasix-org/wasix-docs

Improve API refernce for wasix and wasi

Closed this issue · 2 comments

Currently the functions are outdated in API References.

Example fd_write
In the documentation:

(@interface func (export "fd_write")
    (param $fd $fd)
    ;;; List of scatter/gather vectors from which to retrieve data.
    (param $iovs $ciovec_array)
    (result $error (expected $size (error $errno)))
  )

It should take 4 arguments and documentation should be updated:

Error while importing "wasix_32v1"."fd_write": incompatible import type. Expected Function(FunctionType { params: [I32, I32], results: [I32] }) but received Function(FunctionType { params: [I32, I32, I32, I32], results: [I32] })

Therefore, check all the functions and update all of the functions as there are new PRs like #3830 which would change some functions as well.

@dynamite-bud maybe there is another issue that causes the incompatible import type (backwards compatibility issue perhaps?) - but the document matches up with the export signature from what I can see above. (the last input parameter in the export sig is actually a return variable parameter for $size) which is passed in as a memory address reference - so I don't think this is a documentation issue.

what did you run to get this error?

Closing this as the error for this was caused by something else and the document specification is correct