feat(preview1): implement core I/O functionality#175
feat(preview1): implement core I/O functionality#175rvolosatovs wants to merge 27 commits intobytecodealliance:mainfrom
Conversation
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
This includes, but is not limited to: - `fd_close` - `fd_fdstat_get` - `fd_prestat_dir_name` - `fd_prestat_get` - `fd_pwrite` - `fd_renumber` - `fd_write` - `path_open` Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
40bfdc1 to
1731ed0
Compare
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
bf0d82c to
0ab7fee
Compare
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
0ab7fee to
42e068f
Compare
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
5c40610 to
4f5b662
Compare
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
77b3488 to
99cf3e3
Compare
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
11662c7 to
4a452d2
Compare
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
f99c71c to
58b0869
Compare
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
|
This is really excellent work, I am excited to see this. While you were on vacation, I moved all of the code in this repository over to the wasmtime repository (except sockets, which arent relevant here). Can you please change this PR to apply to the Thank you for finding all of these corner cases where the behavior diverged from the legacy implementation! I think that, rather than take the legacy as the spec, we should consider these all and figure out what the behavior really should be, and make all implementations comform. For each of these corner cases, can you please make a PR that asserts the desired behavior in with a new test in
I agree with this change. Lets upstream it in
Also agreed. Lets upstream it.
Lets do whatever behavior posix does for these cases.
Same, lets align with posix here. |
|
Also, don't worry about leaving this granular commit history when you move things over to the wasmtime repo. |
|
Moved to bytecodealliance/wasmtime#6440 |
This includes, but is not limited to:
fd_advisefd_closefd_fdstat_getfd_filestat_getfd_filestat_set_sizefd_filestat_set_timesfd_prestat_dir_namefd_prestat_getfd_preadfd_pwritefd_readfd_renumberfd_seekfd_writepath_openpath_symlinkpath_unlink_filepath_create_directorypath_remove_directoryNote, that there are a few differences with the adapter, most notably (there may be more, I am following the existing preview1 implementation in Wasmtime):
fd_pwriteuses stream-based I/O respecting theblockingflag, rather than relying onfilesystem::writeas is done in the existing adapterfd_writeandfd_pwritereturn an error even when no data is to be written to invalid FDs, just list the "legacy" Wasmtime preview1 implementation, unlike the existing adapter (which just returns Ok(0) in that case).fd_readexhibits same behavior with empty buffersfd_pwritereturnsSPIPEerrno on writes to stdout/stderr andBADFon writes to stdin, just like the "legacy" Wasmtime preview1 implementation, unlike the existing adapterfd_filestat_set_timesdoes not require a directory or a regular file, but rather works on any FD, including stdio, just like legacy Wasmtime preview1