diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-08-17 20:11:04 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-08-17 20:11:04 -0700 |
| commit | ed50bd1b655ff028bdd650edecdcdd6675f1dee0 (patch) | |
| tree | 18bab13e2631f2ec55fdd5447baa7134c282e4a4 /std/os.zig | |
| parent | 0fbb9e09ea89ea24ec214b244e1de9574516c74c (diff) | |
| download | zig-ed50bd1b655ff028bdd650edecdcdd6675f1dee0.tar.gz zig-ed50bd1b655ff028bdd650edecdcdd6675f1dee0.zip | |
progress toward stack trace printing
Diffstat (limited to 'std/os.zig')
| -rw-r--r-- | std/os.zig | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/std/os.zig b/std/os.zig index a60cd6a575..869054e012 100644 --- a/std/os.zig +++ b/std/os.zig @@ -4,7 +4,7 @@ const errno = @import("errno.zig"); pub error SigInterrupt; pub error Unexpected; -pub fn get_random_bytes(buf: []u8) -> %void { +pub fn getRandomBytes(buf: []u8) -> %void { switch (@compileVar("os")) { linux => { const ret = linux.getrandom(buf.ptr, buf.len, 0); @@ -18,14 +18,18 @@ pub fn get_random_bytes(buf: []u8) -> %void { } } }, - else => @compile_err("unsupported os"), + else => @compileErr("unsupported os"), } } #attribute("cold") pub fn abort() -> unreachable { - linux.raise(linux.SIGABRT); - linux.raise(linux.SIGKILL); - while (true) {} + switch (@compileVar("os")) { + linux => { + linux.raise(linux.SIGABRT); + linux.raise(linux.SIGKILL); + while (true) {} + }, + else => @compileErr("unsupported os"), + } } - |
