summaryrefslogtreecommitdiff
path: root/src/arc4random.h
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2015-09-23 19:39:47 +0200
committerGuillem Jover <guillem@hadrons.org>2015-11-30 23:48:50 +0100
commit874a0e51d3a38596006b3ef7396e62194f467abf (patch)
tree673ca2437779a02f0924bf3eef47044638a6704f /src/arc4random.h
parent9a9a8b2dba2f511c0888499726597add59ae1215 (diff)
Update arc4random module from OpenBSD and LibreSSL
Rework arc4random_stir() and arc4random_addrandom() code over the new internal API, and documentation in the man page. Adapt the code to the local build system. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85827
Diffstat (limited to 'src/arc4random.h')
-rw-r--r--src/arc4random.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/arc4random.h b/src/arc4random.h
new file mode 100644
index 0000000..de52922
--- /dev/null
+++ b/src/arc4random.h
@@ -0,0 +1,29 @@
+#ifndef LIBBSD_ARC4RANDOM_H
+#define LIBBSD_ARC4RANDOM_H
+
+#include <sys/param.h>
+
+int
+getentropy(void *buf, size_t len);
+
+#if defined(__linux__)
+#include "arc4random_linux.h"
+#elif defined(__FreeBSD__)
+#include "arc4random_bsd.h"
+#elif defined(__NetBSD__)
+#include "arc4random_bsd.h"
+#elif defined(__OpenBSD__)
+#include "arc4random_openbsd.h"
+#elif defined(__sun)
+#include "arc4random_unix.h"
+#elif defined(__APPLE__)
+#include "arc4random_unix.h"
+#elif defined(_AIX)
+#include "arc4random_unix.h"
+#elif defined(__hpux)
+#include "arc4random_unix.h"
+#else
+#error "No arc4random hooks defined for this platform."
+#endif
+
+#endif