Add enough Windows functionality to run WASI tutorial (#22)

* Add partial impl of determine_type_rights fn

* Add draft of fd_fdstat_get hostcall

* Add writev wrapper for writing IoVec in RawHandle

* Move IoVec and writev to separate helper crate

* Add Win error handling

Clean up closing and duplicating RawHandle

* Wrap Win file type result

* Add draft impl of fd_close and fd_read

* Refactor getting file access rights

* Remove winapi from the main Cargo.toml

* Add very rough draft of open_path (very incomplete)

* Clean up WinError with macro

* Ignore dir handle in openat if path absolute

* Decode oflags and advance open_path hostcall

* Clean up AccessRight and FlagsAndAttributes flags

* Implement path_get (without symlink expansion yet!)

* Add ShareMode and fix path_get for nested paths

* Add some error mappings between Win and WASI

* Clean up fdflags conversions

* Fix sharing violation when calling openat at '.'

* Apply Alex's fix of using ManuallyDrop instead forget

* Clean up

* Explicitly specify workspace to avoid comp errors at tests
This commit is contained in:
Jakub Konka
2019-06-28 02:10:15 +02:00
committed by Dan Gohman
parent 22c69f46f9
commit 7287767a3f
12 changed files with 1178 additions and 125 deletions

View File

@@ -21,7 +21,8 @@ log = "0.4"
nix = "0.13"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features=["std", "handleapi", "processthreadsapi", "winbase", "ws2def", "fileapi"] }
winx = { path = "winx" }
winapi = "0.3"
[dev-dependencies]
wasmtime-runtime = { git = "https://github.com/cranestation/wasmtime" }
@@ -45,3 +46,5 @@ name = "wasi_common"
crate-type = ["rlib", "staticlib", "cdylib"]
[workspace]
members = ["wasi-common-cbindgen"]
exclude = ["winx"]