wasi-io icon indicating copy to clipboard operation
wasi-io copied to clipboard

Document how `poll_list` handles errors

Open sunfishcode opened this issue 2 years ago • 3 comments

The poll_list function itself doesn't have a return value so it's infallible. We should document how it behaves when passed invalid file descriptors.

sunfishcode avatar Sep 29 '23 22:09 sunfishcode

File descriptors being passed to poll_list are a thing of the past. It should be impossible to create an error because all Pollable resources are always valid to poll on, right?

pchickey avatar Sep 29 '23 22:09 pchickey

Yes, that's right. So we should document what happens if you're using bindings like C and you're using a handle after it's been dropped.

sunfishcode avatar Sep 29 '23 22:09 sunfishcode

Easy enough - it will trap, just like every other case of passing an invalid resource. Agreed we can put it in the docs.

pchickey avatar Sep 29 '23 22:09 pchickey