mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 06:38:47 +00:00
Change algorithm to work on 64-bit integers rather than 32-bit integers internally
This commit is contained in:
@@ -3,10 +3,10 @@ package rand
|
||||
import "core:sys/unix"
|
||||
|
||||
@(require_results)
|
||||
_system_random :: proc() -> u32 {
|
||||
_system_random :: proc() -> u64 {
|
||||
for {
|
||||
value: u32
|
||||
ret := unix.sys_getrandom(([^]u8)(&value), 4, 0)
|
||||
value: u64
|
||||
ret := unix.sys_getrandom(([^]u8)(&value), size_of(value), 0)
|
||||
if ret < 0 {
|
||||
switch ret {
|
||||
case -4: // EINTR
|
||||
|
||||
Reference in New Issue
Block a user