aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-07-04 06:49:55 -0400
committerJack Lloyd <[email protected]>2019-07-04 06:49:55 -0400
commit02aee1fb53dae4439c14f113b2963711890cbde0 (patch)
treec73c2586bdab7518614ed60ea4d73ace4050a4df
parentde278af21cfd2f7a09b47d084e592761a13cba6f (diff)
Fix include for getentropy
Everyone but BSDs puts it in sys/random.h
-rw-r--r--src/build-data/os/linux.txt3
-rw-r--r--src/lib/entropy/getentropy/getentropy.cpp6
2 files changed, 5 insertions, 4 deletions
diff --git a/src/build-data/os/linux.txt b/src/build-data/os/linux.txt
index 208e13b9b..c72114471 100644
--- a/src/build-data/os/linux.txt
+++ b/src/build-data/os/linux.txt
@@ -10,8 +10,9 @@ proc_fs
clock_gettime
getauxval
-# not enabled by default as only available in newer kernel/glibc
+# these are not enabled by default as only available in newer kernel/glibc
#getrandom
+#getentropy
sockets
threads
diff --git a/src/lib/entropy/getentropy/getentropy.cpp b/src/lib/entropy/getentropy/getentropy.cpp
index 67bd67fb9..7e87367a2 100644
--- a/src/lib/entropy/getentropy/getentropy.cpp
+++ b/src/lib/entropy/getentropy/getentropy.cpp
@@ -7,10 +7,10 @@
#include <botan/internal/getentropy.h>
-#if defined(BOTAN_TARGET_OS_IS_MACOS)
- #include <sys/random.h>
-#else
+#if defined(BOTAN_TARGET_OS_IS_OPENBSD) || defined(BOTAN_TARGET_OS_IS_FREEBSD)
#include <unistd.h>
+#else
+ #include <sys/random.h>
#endif
namespace Botan {