aboutsummaryrefslogtreecommitdiffstats
path: root/random.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-05 01:49:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-05 01:49:35 +0000
commit17236de8a6f3b82be1d2b46b76e87e29fef1f96f (patch)
tree4bdccfebbcb7e775e214e412ff6d2526cceab719 /random.c
parent2a827209ae768ea29b0118628c6b59c490520364 (diff)
downloadruby-17236de8a6f3b82be1d2b46b76e87e29fef1f96f.tar.gz
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 06c66ca721..31e7db22f4 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)
{