| author | |
| committer | |
| log | 14a954f3507d97e1a6e6c995f3e4d3db76c64b3d |
| tree | bfb304d239f46244890ebc29f02ed0105d626b25 |
| parent | b23a87953a7a4030af3d9acf8deacb85162dd275 |
2 files changed, 5 insertions(+), 0 deletions(-)
lib/std/c/netbsd.zig+1| ... | ... | @@ -9,6 +9,7 @@ pub const _errno = __errno; |
| 9 | 9 | pub const dl_iterate_phdr_callback = extern fn (info: *dl_phdr_info, size: usize, data: ?*c_void) c_int; |
| 10 | 10 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_void) c_int; |
| 11 | 11 | |
| 12 | pub extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void; | |
| 12 | 13 | pub extern "c" fn __fstat50(fd: fd_t, buf: *Stat) c_int; |
| 13 | 14 | pub extern "c" fn __stat50(path: [*:0]const u8, buf: *Stat) c_int; |
| 14 | 15 | pub extern "c" fn __clock_gettime50(clk_id: c_int, tp: *timespec) c_int; |
lib/std/os.zig+4| ... | ... | @@ -153,6 +153,10 @@ pub fn getrandom(buffer: []u8) GetRandomError!void { |
| 153 | 153 | } |
| 154 | 154 | return; |
| 155 | 155 | } |
| 156 | if (builtin.os.tag == .netbsd) { | |
| 157 | netbsd.arc4random_buf(buffer.ptr, buffer.len); | |
| 158 | return; | |
| 159 | } | |
| 156 | 160 | if (builtin.os.tag == .wasi) { |
| 157 | 161 | switch (wasi.random_get(buffer.ptr, buffer.len)) { |
| 158 | 162 | 0 => return, |