mirror of
https://codeberg.org/landley/toybox.git
synced 2026-01-26 14:13:25 +00:00
getentropy() added to android API 28 in 2018: not quite 7 years yet.
This commit is contained in:
parent
84749b1b7f
commit
4b7334eff4
@ -38,7 +38,7 @@ void xgetrandom(void *buf, unsigned buflen)
|
||||
// BSD/macOS only has getentropy(), but it's in <sys/random.h> (to be fair,
|
||||
// they were there first). getrandom() and getentropy() both went into glibc
|
||||
// in the same release (2.25 in 2017), so this test still works.
|
||||
#if __has_include(<sys/random.h>)
|
||||
#if __has_include(<sys/random.h>) && (!defined(__ANDROID__) || __ANDROID_API__>28)
|
||||
while (buflen) {
|
||||
if (getentropy(buf, fd = buflen>256 ? 256 : buflen)) break;
|
||||
buflen -= fd;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user