mirror of
https://github.com/ptitSeb/box86.git
synced 2024-11-23 09:54:03 +08:00
On system where getrandom syscall is not supported, read /dev/urandom and not /dev/random
This commit is contained in:
parent
df61ed3048
commit
963a7a527a
@ -1181,7 +1181,7 @@ EXPORT int32_t my_getrandom(x86emu_t* emu, void* buf, uint32_t buflen, uint32_t
|
||||
if(f)
|
||||
return ((iFpuu_t)f)(buf, buflen, flags);
|
||||
// do what should not be done, but it's better then nothing....
|
||||
FILE * rnd = fopen("/dev/random", "rb");
|
||||
FILE * rnd = fopen("/dev/urandom", "rb");
|
||||
uint32_t r = fread(buf, 1, buflen, rnd);
|
||||
fclose(rnd);
|
||||
return r;
|
||||
|
Loading…
Reference in New Issue
Block a user