diff options
| author | Shritesh Bhattarai <shritesh@shritesh.com> | 2019-04-30 20:06:39 -0500 |
|---|---|---|
| committer | Shritesh Bhattarai <shritesh@shritesh.com> | 2019-04-30 20:06:39 -0500 |
| commit | 0ce05fa621ba95ba3ce98f99cb14fec549409069 (patch) | |
| tree | 14fe338f6a8d51f2058fc79a8cbf904287e43667 /std | |
| parent | 1fabd6bbf355eb6111c4ed88be97f1ec2bf7b1ae (diff) | |
| download | zig-0ce05fa621ba95ba3ce98f99cb14fec549409069.tar.gz zig-0ce05fa621ba95ba3ce98f99cb14fec549409069.zip | |
wasi: import clock and timestamp function/types
Diffstat (limited to 'std')
| -rw-r--r-- | std/os/wasi/core.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/std/os/wasi/core.zig b/std/os/wasi/core.zig index b296b83c70..77fd831f81 100644 --- a/std/os/wasi/core.zig +++ b/std/os/wasi/core.zig @@ -1,18 +1,28 @@ +pub const clockid_t = u32; pub const errno_t = u16; pub const exitcode_t = u32; pub const fd_t = u32; pub const signal_t = u8; +pub const timestamp_t = u64; pub const ciovec_t = extern struct { buf: [*]const u8, buf_len: usize, }; +pub const CLOCK_REALTIME = 0; +pub const CLOCK_MONOTONIC = 1; +pub const CLOCK_PROCESS_CPUTIME_ID = 2; +pub const CLOCK_THREAD_CPUTIME_ID = 3; + pub const SIGABRT: signal_t = 6; pub extern "wasi_unstable" fn args_get(argv: [*][*]u8, argv_buf: [*]u8) errno_t; pub extern "wasi_unstable" fn args_sizes_get(argc: *usize, argv_buf_size: *usize) errno_t; +pub extern "wasi_unstable" fn clock_res_get(clock_id: clockid_t, resolution: *timestamp_t) errno_t; +pub extern "wasi_unstable" fn clock_time_get(clock_id: clockid_t, precision: timestamp_t, timestamp: *timestamp_t) errno_t; + pub extern "wasi_unstable" fn environ_get(environ: [*]?[*]u8, environ_buf: [*]u8) errno_t; pub extern "wasi_unstable" fn environ_sizes_get(environ_count: *usize, environ_buf_size: *usize) errno_t; |
