Change algorithm to work on 64-bit integers rather than 32-bit integers internally

This commit is contained in:
gingerBill
2023-08-15 10:53:59 +01:00
parent 904c48b11a
commit d13bed9a0a
4 changed files with 28 additions and 131 deletions
+3 -3
View File
@@ -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