diff options
Diffstat (limited to 'compat/getentropy_linux.c')
-rw-r--r-- | compat/getentropy_linux.c | 14 |
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)); |