aboutsummaryrefslogtreecommitdiff
path: root/std/os.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-05-27 00:48:56 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-05-27 00:48:56 -0400
commit6be79d79aab204718116428c9b23be7de54e14da (patch)
treefa420ee5e4869aa41151c8d0a522a3c94b47e3ba /std/os.zig
parent0c6ab61b228211398841cf11912c7252362009b7 (diff)
downloadzig-6be79d79aab204718116428c9b23be7de54e14da.tar.gz
zig-6be79d79aab204718116428c9b23be7de54e14da.zip
fixes for Windows and WASI
Diffstat (limited to 'std/os.zig')
-rw-r--r--std/os.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/std/os.zig b/std/os.zig
index 087d5e12a5..84e92a15d9 100644
--- a/std/os.zig
+++ b/std/os.zig
@@ -99,7 +99,8 @@ pub fn getrandom(buf: []u8) GetRandomError!void {
}
if (linux.is_the_target) {
while (true) {
- switch (errno(system.getrandom(buf.ptr, buf.len, 0))) {
+ // Bypass libc because it's missing on even relatively new versions.
+ switch (linux.getErrno(linux.getrandom(buf.ptr, buf.len, 0))) {
0 => return,
EINVAL => unreachable,
EFAULT => unreachable,