diff options
author | Ondřej Surý <ondrej@sury.org> | 2016-08-30 11:18:13 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2016-08-30 11:21:50 +0200 |
commit | 705053409dade9bc9f691a25f9754a129fa37406 (patch) | |
tree | b4a080db9630fb9a85b63e918c4cc51b8b8f2cec | |
parent | 6a6a85b0ecfbe1a68e0b2d86ba1f75a17f8c1598 (diff) | |
download | luaossl-705053409dade9bc9f691a25f9754a129fa37406.tar.gz luaossl-705053409dade9bc9f691a25f9754a129fa37406.tar.bz2 luaossl-705053409dade9bc9f691a25f9754a129fa37406.zip |
Use syscall() to call getrandom()
-rw-r--r-- | src/openssl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/openssl.c b/src/openssl.c index 136110f..c25651b 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -59,6 +59,7 @@ #include <linux/version.h> #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) #define HAVE_GETRANDOM +#include <sys/syscall.h> #include <linux/random.h> #else #define HAVE_SYS_SYSCTL_H @@ -7852,7 +7853,7 @@ static int randL_stir(struct randL_state *st, unsigned rqstd) { while (count < rqstd) { size_t n = MIN(rqstd - count, sizeof data); - n = getrandom(data, n, 0); + n = syscall(SYS_getrandom, data, n, 0); if (n == -1) { break; |