authorgravatar for shritesh@shritesh.comShritesh Bhattarai <shritesh@shritesh.com> 2019-04-13 22:45:31-05:00
committergravatar for shritesh@shritesh.comShritesh Bhattarai <shritesh@shritesh.com> 2019-04-13 22:45:31-05:00
log22960a5fdf932b63dfdbec1d3cb4efd077e9a776
tree6f0d18196bb31e63d3995d53c866b5e07b22e767
parenta2d8f03092419853b6bbcee45ea759ae994cc2d5

wasi: better comments


1 files changed, 4 insertions(+), 1 deletions(-)

std/os/wasi.zig+4-1
......@@ -1,5 +1,8 @@
11pub use @import("wasi/core.zig");
22
3// Based on https://github.com/CraneStation/wasi-sysroot/blob/wasi/libc-bottom-half/headers/public/wasi/core.h
4// and https://github.com/CraneStation/wasmtime/blob/master/docs/WASI-api.md
5
36pub const STDIN_FILENO = 0;
47pub const STDOUT_FILENO = 1;
58pub const STDERR_FILENO = 2;
......@@ -82,7 +85,7 @@ pub const ETXTBSY = 74;
8285pub const EXDEV = 75;
8386pub const ENOTCAPABLE = 76;
8487
85// TODO: figure out what's going on here
88// TODO: implement this like darwin does
8689pub fn getErrno(r: usize) usize {
8790 const signed_r = @bitCast(isize, r);
8891 return if (signed_r > -4096 and signed_r < 0) @intCast(usize, -signed_r) else 0;