Commit Graph

12 Commits

Author SHA1 Message Date
Dan Gohman
05852977ac Use char/byte literals instead of single-char/byte string literals. 2019-08-14 12:59:00 +02:00
Marcin Mielniczuk
92c2b563fc Reuse errno_from_ioerror to simplify error handling 2019-08-08 18:22:58 +02:00
Jakub Konka
13823e2b39 Clean up fd_renumber 2019-07-22 15:56:46 -07:00
Jakub Konka
310ecb5b5b Create helper Result<T> type 2019-07-22 15:56:46 -07:00
Jakub Konka
667f272edd Rewrite majority of impl reusing libstd (#34)
* Rewrite FdEntry reusing as much libstd as possible

* Use the new FdEntry, FdObject, Descriptor struct in *nix impl

* Adapt Windows impl

* Remove unnecessary check in fd_read

Check `host_nread == 0` caused premature FdEntry closure and removal
which ultimately was resulting in an attempt at "double closing" of
the same file descriptor at the end of the Wasm program:
...
fd_close(fd=4)
    -> errno=WASI_ESUCCESS
fd_close(fd=4)
    -> errno=WASI_EBADF

* Use libstd vectored IO

* Use std:🧵:yield_now to implement sched_yield

* Add logging to integration tests

* Add preliminary support for host-specific errors

* Operate on std::fs::File in path_get on *nix

* Add cross-platform RawString type encapsulating OsStrExt

* Fix Windows build

* Update Travis and README to Rust v1.36

* Remove unused winx::handle::close helper

* Refactor Descriptor into raw handles/fds

* Strip readlinkat in prep for path_get host-independent

* Strip openat in prep for path_get host-independent

* Move ManuallyDrop up one level from Descriptor to FdObject

* Make (c)iovec host fns unsafe

* Swap unwraps/expects for Results in fdentry_impl on nix

* Rewrite fd_pread/write and implement for Win

* Use File::sync_all to impl fd_sync

* Use File::sync_data to impl fd_datasync

* Rewind file cursor after fd_p{read, write} on Windows

* Add fd_p{read, write} tests

* Handle errors instead of panicking in path_get

* Use File::set_len to impl fd_allocate

* Add test for fd_allocate

* Replace all panics with Results

* Document the point of RawString
2019-07-15 15:34:28 -07:00
Jakub Konka
c3ff3cf075 Add template for Windows impl 2019-05-24 11:02:03 -07:00
Jakub Konka
7605584691 Move *nix specific implementation to separate module 2019-05-24 11:02:03 -07:00
Jakub Konka
75ad92b0f3 Insulate API from intricacies of memory mgmt of calling runtimes 2019-05-11 16:50:52 +02:00
Jakub Konka
751a1a1f7b Add experimental struct with views memory and ctxs
This struct is heavily taking from Lucet's Vmctx struct.
2019-05-10 22:23:35 +02:00
Jakub Konka
2587fa0145 Port WASI host types 2019-05-07 21:44:16 +02:00
Jakub Konka
ce6f9cb165 Changes to compile in lucet 2019-05-06 09:51:54 +02:00
Jakub Konka
cd39c1dfd8 Extract common interface from lucet-wasi 2019-05-04 18:20:21 +02:00