Skip to content

Commit 471c1b7

Browse files
authored
Merge pull request #61 from sunfishcode/resources
Update to resources.
2 parents 2534b91 + c0ec64e commit 471c1b7

File tree

15 files changed

+1275
-1214
lines changed

15 files changed

+1275
-1214
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ jobs:
1010
name: Check ABI files are up-to-date
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
- name: ensure `./wit/deps` are in sync
1515
run: |
1616
curl -Lo 'wit-deps' https://github.com/bytecodealliance/wit-deps/releases/download/v0.3.0/wit-deps-x86_64-unknown-linux-musl
1717
chmod +x wit-deps
1818
./wit-deps lock
1919
git add -N wit/deps
2020
git diff --exit-code
21-
- uses: WebAssembly/wit-abi-up-to-date@v13
22-
with:
23-
wit-abi-tag: wit-abi-0.11.0
21+
- uses: WebAssembly/wit-abi-up-to-date@v14

Posix-compatibility.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ None of the flags are directly present in WASI Sockets:
104104
- UDP: N/A
105105

106106
### `close`
107-
- TCP: [`tcp::drop-tcp-socket`](tcp)
108-
- UDP: [`udp::drop-udp-socket`](udp)
107+
Dropping a handle performs an effective `close`.
109108

110109
### `socketpair`, `connectat` (non-standard), `bindat` (non-standard)
111110
Specifically for UNIX domain sockets. Out of scope for this proposal.
@@ -599,4 +598,4 @@ Columns:
599598
[udp-create-socket]: https://github.com/WebAssembly/wasi-sockets/blob/main/wit/udp-create-socket.wit
600599
[udp]: https://github.com/WebAssembly/wasi-sockets/blob/main/wit/udp.wit
601600
[poll]: https://github.com/WebAssembly/wasi-poll/blob/main/wit/poll.wit
602-
[streams]: https://github.com/WebAssembly/wasi-io/blob/main/wit/streams.wit
601+
[streams]: https://github.com/WebAssembly/wasi-io/blob/main/wit/streams.wit

example-world.md renamed to imports.md

Lines changed: 514 additions & 479 deletions
Large diffs are not rendered by default.

wit/deps.lock

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
[io]
2-
url = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
3-
sha256 = "eeb4701c2becafa40a7ee3bf0d2c94e2170e15806b25abdcd1de1ed94f2c1036"
4-
sha512 = "89be853b2acae211570cd6ad0ec9d8132881dafbdea83ac7b4cad600f0627003c61f310427379bf47ecf862724367bd5d6e976db70069f6f90a3c2d9c20dbfb7"
5-
6-
[poll]
7-
url = "https://github.com/WebAssembly/wasi-poll/archive/main.tar.gz"
8-
sha256 = "9f8bb4d9994e9b0684859bb1e8bee2a8b873e04d40695f260446760fc44d0c58"
9-
sha512 = "aa8da395ba6e189ec113296996da5abf28bdc4460e4eb2aacc786698ced892e08f7054fb590fc8809c05554d5c83a11494d4ab68c755746f57d151e212415cfb"
2+
url = "https://github.com/sunfishcode/wasi-io/archive/resources.tar.gz"
3+
sha256 = "6e20bcf4d4f5466b60c05ea8da7289ca361a7febdd22ab1a531e5ef7e394ab8d"
4+
sha512 = "21f6689bce6ed6d9e3bd96372e5c7ed003a7aefbf8d49b4eea949dfbd265cf57a0d7dc67aa71e3de75d48fcc2c0cfe5f06f7e9e7959a23bc98f77da85f4161b9"

wit/deps.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
io = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
2-
poll = "https://github.com/WebAssembly/wasi-poll/archive/main.tar.gz"
1+
# Temporarily use the resources branches.
2+
#io = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
3+
io = "https://github.com/sunfishcode/wasi-io/archive/resources.tar.gz"

wit/deps/io/poll.wit

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package wasi:io
2+
3+
/// A poll API intended to let users wait for I/O events on multiple handles
4+
/// at once.
5+
interface poll {
6+
/// A "pollable" handle.
7+
resource pollable
8+
9+
/// Poll for completion on a set of pollables.
10+
///
11+
/// This function takes a list of pollables, which identify I/O sources of
12+
/// interest, and waits until one or more of the events is ready for I/O.
13+
///
14+
/// The result `list<u32>` contains one or more indices of handles in the
15+
/// argument list that is ready for I/O.
16+
///
17+
/// If the list contains more elements than can be indexed with a `u32`
18+
/// value, this function traps.
19+
///
20+
/// A timeout can be implemented by adding a pollable from the
21+
/// wasi-clocks API to the list.
22+
///
23+
/// This function does not return a `result`; polling in itself does not
24+
/// do any I/O so it doesn't fail. If any of the I/O sources identified by
25+
/// the pollables has an error, it is indicated by marking the source as
26+
/// being reaedy for I/O.
27+
poll-list: func(in: list<borrow<pollable>>) -> list<u32>
28+
29+
/// Poll for completion on a single pollable.
30+
///
31+
/// This function is similar to `poll-list`, but operates on only a single
32+
/// pollable. When it returns, the handle is ready for I/O.
33+
poll-one: func(in: borrow<pollable>)
34+
}

0 commit comments

Comments
 (0)