Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.

Commit 701fefa

Browse files
committed
Convert tabs to whitespaces
1 parent 0cd8492 commit 701fefa

File tree

9 files changed

+716
-716
lines changed

9 files changed

+716
-716
lines changed

Posix-compatibility.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,12 @@ Additionally, most columns have been populated semi-automatically by grepping th
135135
Columns:
136136
- "Socket option": The native option constant.
137137
- "WASI":
138-
- ✅ = Included in proposal.
139-
- ⛔ = Consciously decided _not_ to include in WASI. See notes for explanation.
140-
- ❔ = Not included (yet), for no particular reason.
138+
- ✅ = Included in proposal.
139+
- ⛔ = Consciously decided _not_ to include in WASI. See notes for explanation.
140+
- ❔ = Not included (yet), for no particular reason.
141141
- The rest:
142-
- ✅ = Option is provided by the platform / depended upon by the application.
143-
- ❌ = Option is not provided / not used.
142+
- ✅ = Option is provided by the platform / depended upon by the application.
143+
- ❌ = Option is not provided / not used.
144144

145145
> Note: GitHub clips the table content. Scroll left and right to see all columns, or use the Code View.
146146

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ finish-operation: func(this) -> result<the-outputs..., error-code>
8888

8989
The semantics are as follows:
9090
- When `start-*` completes successfully:
91-
- The operation should be considered "in progress".
92-
- This is the POSIX equivalent of EINPROGRESS.
93-
- The socket can be polled for completion of the just started operation, using `wasi-poll`.
94-
- Its corresponding `finish-*` function can be called until it returns something other than the `would-block` error code.
91+
- The operation should be considered "in progress".
92+
- This is the POSIX equivalent of EINPROGRESS.
93+
- The socket can be polled for completion of the just started operation, using `wasi-poll`.
94+
- Its corresponding `finish-*` function can be called until it returns something other than the `would-block` error code.
9595
- When `finish-*` returns anything other than `would-block`:
96-
- The asynchronous operation should be considered "finished" (either successful or failed)
97-
- Future calls to `finish-*` return the `not-in-progress` error code.
96+
- The asynchronous operation should be considered "finished" (either successful or failed)
97+
- Future calls to `finish-*` return the `not-in-progress` error code.
9898

9999
Runtimes that don't need asynchrony, can simply validate the arguments provided to the `start` function and stash them on their internal socket instance and perform the actual syscall in the `finish` function. Conveniently, sockets only allow one of these `start/finish` asynchronous operation to be active at a time.
100100

@@ -103,22 +103,22 @@ Example of how to recover blocking semantics in guest code:
103103
```rs
104104
// Pseudo code:
105105
fn blocking-connect(sock: tcp-socket, addr: ip-socket-address) -> result<tuple<input-stream, output-stream>, error-code> {
106-
107-
let pollable = tcp::subscribe(tcp-socket);
108-
109-
let start-result = tcp::start-connect(sock, addr);
110-
if (start-result is error) {
111-
return error;
112-
}
113-
114-
while (true) {
115-
poll::poll-oneoff([ pollable ]);
116-
117-
let finish-result = tcp::finish-connect(sock);
118-
if (finish-result is NOT error(would-block)) {
119-
return finish-result;
120-
}
121-
}
106+
107+
let pollable = tcp::subscribe(tcp-socket);
108+
109+
let start-result = tcp::start-connect(sock, addr);
110+
if (start-result is error) {
111+
return error;
112+
}
113+
114+
while (true) {
115+
poll::poll-oneoff([ pollable ]);
116+
117+
let finish-result = tcp::finish-connect(sock);
118+
if (finish-result is NOT error(would-block)) {
119+
return finish-result;
120+
}
121+
}
122122
}
123123

124124
```

wit/instance-network.wit

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
/// This interface provides a value-export of the default network handle..
33
interface instance-network {
4-
use network.{network};
4+
use network.{network};
55

6-
/// Get a handle to the default network.
7-
instance-network: func() -> network;
6+
/// Get a handle to the default network.
7+
instance-network: func() -> network;
88

99
}

wit/ip-name-lookup.wit

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
11

22
interface ip-name-lookup {
3-
use wasi:io/poll.{pollable};
4-
use network.{network, error-code, ip-address, ip-address-family};
3+
use wasi:io/poll.{pollable};
4+
use network.{network, error-code, ip-address, ip-address-family};
55

66

7-
/// Resolve an internet host name to a list of IP addresses.
8-
///
9-
/// See the wasi-socket proposal README.md for a comparison with getaddrinfo.
10-
///
11-
/// # Parameters
12-
/// - `name`: The name to look up. IP addresses are not allowed. Unicode domain names are automatically converted
13-
/// to ASCII using IDNA encoding.
14-
/// - `address-family`: If provided, limit the results to addresses of this specific address family.
15-
/// - `include-unavailable`: When set to true, this function will also return addresses of which the runtime
16-
/// thinks (or knows) can't be connected to at the moment. For example, this will return IPv6 addresses on
17-
/// systems without an active IPv6 interface. Notes:
18-
/// - Even when no public IPv6 interfaces are present or active, names like "localhost" can still resolve to an IPv6 address.
19-
/// - Whatever is "available" or "unavailable" is volatile and can change everytime a network cable is unplugged.
20-
///
21-
/// This function never blocks. It either immediately fails or immediately returns successfully with a `resolve-address-stream`
22-
/// that can be used to (asynchronously) fetch the results.
23-
///
24-
/// At the moment, the stream never completes successfully with 0 items. Ie. the first call
25-
/// to `resolve-next-address` never returns `ok(none)`. This may change in the future.
26-
///
27-
/// # Typical errors
28-
/// - `invalid-name`: `name` is a syntactically invalid domain name.
29-
/// - `invalid-name`: `name` is an IP address.
30-
/// - `address-family-not-supported`: The specified `address-family` is not supported. (EAI_FAMILY)
31-
///
32-
/// # References:
33-
/// - <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html>
34-
/// - <https://man7.org/linux/man-pages/man3/getaddrinfo.3.html>
35-
/// - <https://learn.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfo>
36-
/// - <https://man.freebsd.org/cgi/man.cgi?query=getaddrinfo&sektion=3>
37-
resolve-addresses: func(network: borrow<network>, name: string, address-family: option<ip-address-family>, include-unavailable: bool) -> result<resolve-address-stream, error-code>;
7+
/// Resolve an internet host name to a list of IP addresses.
8+
///
9+
/// See the wasi-socket proposal README.md for a comparison with getaddrinfo.
10+
///
11+
/// # Parameters
12+
/// - `name`: The name to look up. IP addresses are not allowed. Unicode domain names are automatically converted
13+
/// to ASCII using IDNA encoding.
14+
/// - `address-family`: If provided, limit the results to addresses of this specific address family.
15+
/// - `include-unavailable`: When set to true, this function will also return addresses of which the runtime
16+
/// thinks (or knows) can't be connected to at the moment. For example, this will return IPv6 addresses on
17+
/// systems without an active IPv6 interface. Notes:
18+
/// - Even when no public IPv6 interfaces are present or active, names like "localhost" can still resolve to an IPv6 address.
19+
/// - Whatever is "available" or "unavailable" is volatile and can change everytime a network cable is unplugged.
20+
///
21+
/// This function never blocks. It either immediately fails or immediately returns successfully with a `resolve-address-stream`
22+
/// that can be used to (asynchronously) fetch the results.
23+
///
24+
/// At the moment, the stream never completes successfully with 0 items. Ie. the first call
25+
/// to `resolve-next-address` never returns `ok(none)`. This may change in the future.
26+
///
27+
/// # Typical errors
28+
/// - `invalid-name`: `name` is a syntactically invalid domain name.
29+
/// - `invalid-name`: `name` is an IP address.
30+
/// - `address-family-not-supported`: The specified `address-family` is not supported. (EAI_FAMILY)
31+
///
32+
/// # References:
33+
/// - <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html>
34+
/// - <https://man7.org/linux/man-pages/man3/getaddrinfo.3.html>
35+
/// - <https://learn.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfo>
36+
/// - <https://man.freebsd.org/cgi/man.cgi?query=getaddrinfo&sektion=3>
37+
resolve-addresses: func(network: borrow<network>, name: string, address-family: option<ip-address-family>, include-unavailable: bool) -> result<resolve-address-stream, error-code>;
3838

39-
resource resolve-address-stream {
40-
/// Returns the next address from the resolver.
41-
///
42-
/// This function should be called multiple times. On each call, it will
43-
/// return the next address in connection order preference. If all
44-
/// addresses have been exhausted, this function returns `none`.
45-
///
46-
/// This function never returns IPv4-mapped IPv6 addresses.
47-
///
48-
/// # Typical errors
49-
/// - `name-unresolvable`: Name does not exist or has no suitable associated IP addresses. (EAI_NONAME, EAI_NODATA, EAI_ADDRFAMILY)
50-
/// - `temporary-resolver-failure`: A temporary failure in name resolution occurred. (EAI_AGAIN)
51-
/// - `permanent-resolver-failure`: A permanent failure in name resolution occurred. (EAI_FAIL)
52-
/// - `would-block`: A result is not available yet. (EWOULDBLOCK, EAGAIN)
53-
resolve-next-address: func() -> result<option<ip-address>, error-code>;
39+
resource resolve-address-stream {
40+
/// Returns the next address from the resolver.
41+
///
42+
/// This function should be called multiple times. On each call, it will
43+
/// return the next address in connection order preference. If all
44+
/// addresses have been exhausted, this function returns `none`.
45+
///
46+
/// This function never returns IPv4-mapped IPv6 addresses.
47+
///
48+
/// # Typical errors
49+
/// - `name-unresolvable`: Name does not exist or has no suitable associated IP addresses. (EAI_NONAME, EAI_NODATA, EAI_ADDRFAMILY)
50+
/// - `temporary-resolver-failure`: A temporary failure in name resolution occurred. (EAI_AGAIN)
51+
/// - `permanent-resolver-failure`: A permanent failure in name resolution occurred. (EAI_FAIL)
52+
/// - `would-block`: A result is not available yet. (EWOULDBLOCK, EAGAIN)
53+
resolve-next-address: func() -> result<option<ip-address>, error-code>;
5454

55-
/// Create a `pollable` which will resolve once the stream is ready for I/O.
56-
///
57-
/// Note: this function is here for WASI Preview2 only.
58-
/// It's planned to be removed when `future` is natively supported in Preview3.
59-
subscribe: func() -> pollable;
60-
}
55+
/// Create a `pollable` which will resolve once the stream is ready for I/O.
56+
///
57+
/// Note: this function is here for WASI Preview2 only.
58+
/// It's planned to be removed when `future` is natively supported in Preview3.
59+
subscribe: func() -> pollable;
60+
}
6161
}

0 commit comments

Comments
 (0)