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

@@ -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=