Removes the StubTaskManager implementation.
A WASI(X) module requires a VirtualTaskManager implementation to do
anything useful.
Having this implmementation doesn't make sense anymore, it only invites
misuse.
* Rename BidiPipe to DuplexPipe, because the name is better
* Make the fields private: gives us more flexibility in the future
* Add a split() method and accessors for send and receive
The WasiPipe::channel() function is a leftover from a previous
implementation.
It pipes data through two different Pipes, which doesn't actually make
any sense in most circumstances.
Best to remove the function.
Users should just use Pipe::new(), or DuplexPipe::new().
libc was added as a dependency to vnet for error mapping.
This breaks JS targets.
Removed the dependency, and removed the mapping functions.
Will be added again in the wasi crate.
The implementations were previously already replaced with stub impls.
After ensuring that the current wasix modules don't actually import the
syscalls, we can now safely remove all the plumbing, including:
* syscalls
* types
Since LocalNetworking was an empty struct, it could have been
constructed by anyone , which would lead to a breaking change if we need
to add any fields.
This commit adds a private stub field to prevent that.
Also adds a LocalNetworking::new() constructor
WASIX networking will now only be enabled if the --net flag is provided.
Otherwise it would break the Wasmer sandboxing promise.
In the future we should add more advanced networking config.
(like only allow certain ports, limit dns domains, limit ip ranges, etc )
- Removed generation_arena which was causing some serious leakages of files and sockets
- Added OsError for NetworkErrors so that "Too Many Open Files" is properly passed
- Local networking will now cap at 10 sockets in the backlog
- Added the missing shutdown error code
- Removed the inodes lock around most of the WASI syscalls
- Fixed some race conditions in the event notifications for WASI
- The polling loop will now only notify a closed socket once
- Event notifications now uses Wakers rather than MPSC
- Some socket errors now return the right codes which prevents panics in WASM
- Fixed a bug where the file read and write guards might release the file before the lock
- The inode seed is now much safer preventing overlaps
- The fd seed is now much safer preventing overlaps
- Closing files is now implicit rather than explicit reducing possibliities for error
- Forking of file descriptors is now much simplier
- Polling events will now be returned in random order to prevent some race conditions
- Removed a number of memory allocations which were wasting memory and performance
- Sockets now only copy the send and recv data once rather than multiple times