summaryrefslogtreecommitdiffhomepage
path: root/auto/unix
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2018-07-16 13:30:11 +0300
committerSergey Kandaurov <pluknet@nginx.com>2018-07-16 13:30:11 +0300
commit7c5a710c5543debff0c70cb4839e15e9a1da322b (patch)
treea7ee30b8e7aa308a19ee8a98bc745f6a26d9cf38 /auto/unix
parentbf1cb8f399b2b580da5c014439eff038e9d1315f (diff)
downloadunit-7c5a710c5543debff0c70cb4839e15e9a1da322b.tar.gz
unit-7c5a710c5543debff0c70cb4839e15e9a1da322b.tar.bz2
Added getentropy() support.
Prodded by David Carlier.
Diffstat (limited to '')
-rw-r--r--auto/unix43
1 files changed, 43 insertions, 0 deletions
diff --git a/auto/unix b/auto/unix
index ddb41934..5813e5e8 100644
--- a/auto/unix
+++ b/auto/unix
@@ -48,6 +48,49 @@ if [ $nxt_found = no ]; then
fi
+if [ $nxt_found = no ]; then
+
+ # OpenBSD 5.6 lacks <sys/random.h>.
+
+ nxt_feature="getentropy()"
+ nxt_feature_name=NXT_HAVE_GETENTROPY
+ nxt_feature_test="#include <unistd.h>
+
+ int main() {
+ char buf[4];
+
+ if (getentropy(buf, 4) == -1) {
+ return 1;
+ }
+
+ return 0;
+ }"
+ . auto/feature
+fi
+
+
+if [ $nxt_found = no ]; then
+
+ # macOS 10.12.
+
+ nxt_feature="getentropy() in sys/random.h"
+ nxt_feature_name=NXT_HAVE_GETENTROPY_SYS_RANDOM
+ nxt_feature_test="#include <unistd.h>
+ #include <sys/random.h>
+
+ int main() {
+ char buf[4];
+
+ if (getentropy(buf, 4) == -1) {
+ return 1;
+ }
+
+ return 0;
+ }"
+ . auto/feature
+fi
+
+
nxt_feature="ucontext"
nxt_feature_name=NXT_HAVE_UCONTEXT
nxt_feature_run=