Added getentropy() support.

Prodded by David Carlier.
This commit is contained in:
Sergey Kandaurov
2018-07-16 13:30:11 +03:00
parent bf1cb8f399
commit 7c5a710c55
3 changed files with 53 additions and 0 deletions

View File

@@ -68,6 +68,14 @@ nxt_random_stir(nxt_random_t *r)
n = syscall(SYS_getrandom, &key, NXT_RANDOM_KEY_SIZE, 0);
#elif (NXT_HAVE_GETENTROPY || NXT_HAVE_GETENTROPY_SYS_RANDOM)
n = 0;
if (getentropy(&key, NXT_RANDOM_KEY_SIZE) == 0) {
n = NXT_RANDOM_KEY_SIZE;
}
#else
n = 0;