mirror of https://github.com/D4-project/d4-core
parent
60cfbcb250
commit
e0d101dc3a
|
@ -100,11 +100,15 @@ int random_get_fd(void)
|
|||
|
||||
int my_getentropy(void *buf, size_t buflen)
|
||||
{
|
||||
#ifdef __GLIBC__
|
||||
if (buflen > 256) {
|
||||
errno = EIO;
|
||||
return -1;
|
||||
}
|
||||
return syscall(SYS_getrandom, buf, buflen, 0);
|
||||
#else
|
||||
return getentropy(buf, buflen);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue