summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_random.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/nxt_random.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nxt_random.c b/src/nxt_random.c
index b6c9f704..aaa39887 100644
--- a/src/nxt_random.c
+++ b/src/nxt_random.c
@@ -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;