You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`HostPrint`|`String`|`Int`| Used by the `write()` stub. Only stdout (fd 1) and stderr (fd 2) are supported; both delegate to this single host function. Other file descriptors return `EBADF`. |
33
-
|`HostRead`|`ULong` (byte count) |`VecBytes`| Used by the `read()` stub. Only stdin (fd 0) is supported; other file descriptors return `EBADF`. |
34
-
|`CurrentTime`|_(none)_|`VecBytes`| Used by `clock_gettime()` and `gettimeofday()`. Should return 16 bytes: 8 bytes of seconds + 8 bytes of nanoseconds. If not provided, a monotonic fallback starting at Unix timestamp `1609459200` (2021-01-01) is used. |
28
+
The `read()` stub returns **EOF (0)** immediately for stdin (fd 0) without
29
+
contacting the host. Other file descriptors return `EBADF`.
30
+
31
+
### Write (stdout / stderr)
32
+
33
+
The `write()` stub delegates to the `HostPrint` host function. Only stdout
34
+
(fd 1) and stderr (fd 2) are supported; both map to the same `HostPrint`
35
+
call, which accepts a `String` parameter and returns an `Int`. Other file
36
+
descriptors return `EBADF`.
37
+
38
+
### Time
39
+
40
+
The `clock_gettime()`, `gettimeofday()`, and `_current_time()` stubs do
41
+
**not** call out to the host. Instead they return a synthetic
42
+
monotonically-increasing timestamp: the first call returns Unix epoch + 1 s
43
+
(`1970-01-01 00:00:01`), the second returns epoch + 2 s, and so on. The
0 commit comments