summaryrefslogtreecommitdiffstats
path: root/compat/getentropy_linux.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2015-04-26 11:23:26 +0000
committerdes <des@FreeBSD.org>2015-04-26 11:23:26 +0000
commitfe0c01d26579d19ddf439fb46ef0bd3cc2bc7f4c (patch)
tree01c1d94467622a175fad10cd34a2f6f05d32c1b7 /compat/getentropy_linux.c
parentcabe860377233bc13a6d101fdb59bb834cab980a (diff)
downloadFreeBSD-src-fe0c01d26579d19ddf439fb46ef0bd3cc2bc7f4c.zip
FreeBSD-src-fe0c01d26579d19ddf439fb46ef0bd3cc2bc7f4c.tar.gz
import unbound 1.5.2
Diffstat (limited to 'compat/getentropy_linux.c')
-rw-r--r--compat/getentropy_linux.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/compat/getentropy_linux.c b/compat/getentropy_linux.c
index 32d58a7..60e010d 100644
--- a/compat/getentropy_linux.c
+++ b/compat/getentropy_linux.c
@@ -474,22 +474,24 @@ getentropy_fallback(void *buf, size_t len)
HD(cnt);
}
-#ifdef AT_RANDOM
+#ifdef HAVE_GETAUXVAL
+# ifdef AT_RANDOM
/* Not as random as you think but we take what we are given */
p = (char *) getauxval(AT_RANDOM);
if (p)
HR(p, 16);
-#endif
-#ifdef AT_SYSINFO_EHDR
+# endif
+# ifdef AT_SYSINFO_EHDR
p = (char *) getauxval(AT_SYSINFO_EHDR);
if (p)
HR(p, pgs);
-#endif
-#ifdef AT_BASE
+# endif
+# ifdef AT_BASE
p = (char *) getauxval(AT_BASE);
if (p)
HD(p);
-#endif
+# endif
+#endif /* HAVE_GETAUXVAL */
SHA512_Final(results, &ctx);
memcpy((char*)buf + i, results, min(sizeof(results), len - i));
OpenPOWER on IntegriCloud