Skip to content

Commit 213c3d2

Browse files
authored
Revert "Disable support for nonblocking file I/O (#796)"
This reverts commit 161b319.
1 parent 161b319 commit 213c3d2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • libc-bottom-half/sources

libc-bottom-half/sources/file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static int file_get_read_stream(void *data, wasi_read_t *read) {
123123
#endif
124124
read->offset = &file->offset;
125125
read->timeout = 0;
126-
read->blocking = true;
126+
read->blocking = (file->oflag & O_NONBLOCK) == 0;
127127
return 0;
128128
}
129129

@@ -193,7 +193,7 @@ static int file_get_write_stream(void *data, wasi_write_t *write) {
193193
#endif
194194
write->offset = &file->offset;
195195
write->timeout = 0;
196-
write->blocking = true;
196+
write->blocking = (file->oflag & O_NONBLOCK) == 0;
197197
return 0;
198198
}
199199

0 commit comments

Comments
 (0)