|
5 | 5 | ;; This is a `witx` file. See [here](https://github.com/WebAssembly/WASI/tree/master/docs/witx.md)
|
6 | 6 | ;; for an explanation of what that means.
|
7 | 7 |
|
8 |
| -(use "typenames.witx") |
| 8 | +(use $errno $clockid $timestamp from $typenames) |
9 | 9 |
|
10 |
| -(module $wasi_ephemeral_clock |
11 |
| - ;;; Linear memory to be accessed by WASI functions that need it. |
12 |
| - (import "memory" (memory)) |
13 |
| - |
14 |
| - ;;; Return the resolution of a clock. |
15 |
| - ;;; Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks, |
16 |
| - ;;; return `errno::inval`. |
17 |
| - ;;; Note: This is similar to `clock_getres` in POSIX. |
18 |
| - (@interface func (export "res_get") |
19 |
| - ;;; The clock for which to return the resolution. |
20 |
| - (param $id $clockid) |
21 |
| - ;;; The resolution of the clock. |
22 |
| - (result $error (expected $timestamp (error $errno))) |
23 |
| - ) |
| 10 | +;;; Return the resolution of a clock. |
| 11 | +;;; Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks, |
| 12 | +;;; return `errno::inval`. |
| 13 | +;;; Note: This is similar to `clock_getres` in POSIX. |
| 14 | +(@interface func (export "res_get") |
| 15 | + ;;; The clock for which to return the resolution. |
| 16 | + (param $id $clockid) |
| 17 | + ;;; The resolution of the clock. |
| 18 | + (result $error (expected $timestamp (error $errno))) |
| 19 | +) |
24 | 20 |
|
25 |
| - ;;; Return the time value of a clock. |
26 |
| - ;;; Note: This is similar to `clock_gettime` in POSIX. |
27 |
| - (@interface func (export "time_get") |
28 |
| - ;;; The clock for which to return the time. |
29 |
| - (param $id $clockid) |
30 |
| - ;;; The maximum lag (exclusive) that the returned time value may have, compared to its actual value. |
31 |
| - (param $precision $timestamp) |
32 |
| - ;;; The time value of the clock. |
33 |
| - (result $error (expected $timestamp (error $errno))) |
34 |
| - ) |
| 21 | +;;; Return the time value of a clock. |
| 22 | +;;; Note: This is similar to `clock_gettime` in POSIX. |
| 23 | +(@interface func (export "time_get") |
| 24 | + ;;; The clock for which to return the time. |
| 25 | + (param $id $clockid) |
| 26 | + ;;; The maximum lag (exclusive) that the returned time value may have, compared to its actual value. |
| 27 | + (param $precision $timestamp) |
| 28 | + ;;; The time value of the clock. |
| 29 | + (result $error (expected $timestamp (error $errno))) |
35 | 30 | )
|
0 commit comments