Skip to content

Commit

Permalink
fix: allow pollOneoff for EventTypeFdWrite
Browse files Browse the repository at this point in the history
Note this is still a dirty fix... Eventually upstream needs to fully implement this with some major refactoring of the codebase.

Signed-off-by: Gaukas Wang <[email protected]>
  • Loading branch information
gaukas committed Jan 13, 2024
1 parent 5b45006 commit 9414800
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions imports/wasi_snapshot_preview1/poll.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ func pollOneoffFn(_ context.Context, mod api.Module, params []uint64) sys.Errno
if fd < 0 {
return sys.EBADF
}
if _, ok := fsc.LookupFile(fd); ok {
evt.errno = wasip1.ErrnoNotsup
if file, ok := fsc.LookupFile(fd); ok {
if !file.File.IsNonblock() {
evt.errno = wasip1.ErrnoNotsup
}
} else {
evt.errno = wasip1.ErrnoBadf
}
Expand Down

0 comments on commit 9414800

Please sign in to comment.