summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-05 01:49:35 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-05 01:49:35 (GMT)
commit4a066896af896a7f8098537ae4e728a405bb80f2 (patch)
tree4bdccfebbcb7e775e214e412ff6d2526cceab719 /random.c
parent903161e0af9b52b6ec182783744abcb7170d522a (diff)
random.c: use arc4random_buf
* random.c (fill_random_bytes_syscall): use arc4random_buf if available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/random.c b/random.c
index 06c66ca..31e7db2 100644
--- a/random.c
+++ b/random.c
@@ -480,7 +480,10 @@ fill_random_bytes_urandom(void *seed, size_t size)
# define fill_random_bytes_urandom(seed, size) -1
#endif
-#if defined(_WIN32)
+#if 0
+#elif defined(HAVE_ARC4RANDOM_BUF)
+#define fill_random_bytes_syscall(buf, size, unused) (arc4random_buf(buf, size), 0)
+#elif defined(_WIN32)
static void
release_crypt(void *p)
{