diff options
Diffstat (limited to 'okio-testing-support/src/wasmWasiMain/kotlin/okio/internal/preview1/Preview1Clock.kt')
-rw-r--r-- | okio-testing-support/src/wasmWasiMain/kotlin/okio/internal/preview1/Preview1Clock.kt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/okio-testing-support/src/wasmWasiMain/kotlin/okio/internal/preview1/Preview1Clock.kt b/okio-testing-support/src/wasmWasiMain/kotlin/okio/internal/preview1/Preview1Clock.kt new file mode 100644 index 00000000..50726af1 --- /dev/null +++ b/okio-testing-support/src/wasmWasiMain/kotlin/okio/internal/preview1/Preview1Clock.kt @@ -0,0 +1,19 @@ +// Copyright 2019-2023 the Contributors to the WASI Specification +// This file is adapted from the WASI preview1 spec here: +// https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md +package okio.internal.preview1 + +import kotlin.wasm.WasmImport + +/** + * clock_time_get(id: clockid, precision: timestamp) -> Result<timestamp, errno> + * + * Return the time value of a clock. + * Note: This is similar to `clock_gettime` in POSIX. + */ +@WasmImport("wasi_snapshot_preview1", "clock_time_get") +internal external fun clock_time_get( + id: clockid, + precision: Long, + returnPointer: Int, +): Int // should be Short?? |