| ... | ... | @@ -59,11 +59,9 @@ pub fn getRandomBytes(buf: []u8) -> %void { |
| 59 | 59 | while (true) { |
| 60 | 60 | const err = switch (builtin.os) { |
| 61 | 61 | Os.linux => { |
| 62 | | if (builtin.link_libc) { |
| 63 | | if (c.getrandom(buf.ptr, buf.len, 0) == -1) *c._errno() else 0 |
| 64 | | } else { |
| 65 | | posix.getErrno(posix.getrandom(buf.ptr, buf.len, 0)) |
| 66 | | } |
| 62 | // TODO check libc version and potentially call c.getrandom. |
| 63 | // See #397 |
| 64 | posix.getErrno(posix.getrandom(buf.ptr, buf.len, 0)) |
| 67 | 65 | }, |
| 68 | 66 | Os.darwin, Os.macosx, Os.ios => { |
| 69 | 67 | if (builtin.link_libc) { |