From bb4a532785e8bcd0080eeac291bd3b205279f045 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 4 Feb 2016 01:00:54 -0700 Subject: move os_get_random_bytes to os.zig --- std/std.zig | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'std/std.zig') diff --git a/std/std.zig b/std/std.zig index d628692ae0..70753c0c82 100644 --- a/std/std.zig +++ b/std/std.zig @@ -160,18 +160,6 @@ pub struct InStream { } } -pub fn os_get_random_bytes(buf: []u8) -> %void { - const amt_got = getrandom(buf.ptr, buf.len, 0); - if (amt_got < 0) { - return switch (-amt_got) { - EINVAL => unreachable{}, - EFAULT => unreachable{}, - EINTR => error.SigInterrupt, - else => error.Unexpected, - } - } -} - #attribute("cold") pub fn abort() -> unreachable { raise(SIGABRT); -- cgit v1.2.3