summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-11 11:05:20 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-11 11:05:20 (GMT)
commit6f7fafbf004af03cc476648be02c9dc3cc1b4f3d (patch)
tree01e3df96b7ecfa279721ff05cc0c4954daccb9dc
parentdb40f678493b5e36d1e8af94ea79b6b0bc2c11ea (diff)
random.c: prefixed fill_random_bytes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--internal.h2
-rw-r--r--random.c4
-rw-r--r--vm_insnhelper.c2
3 files changed, 5 insertions, 3 deletions
diff --git a/internal.h b/internal.h
index bfbd90b..fec6d3c 100644
--- a/internal.h
+++ b/internal.h
@@ -2104,7 +2104,7 @@ VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0)
#endif
/* random.c */
-int fill_random_bytes(void *, size_t, int);
+int ruby_fill_random_bytes(void *, size_t, int);
RUBY_SYMBOL_EXPORT_END
diff --git a/random.c b/random.c
index d8cfd38..fbcacca 100644
--- a/random.c
+++ b/random.c
@@ -574,13 +574,15 @@ fill_random_bytes_syscall(void *seed, size_t size, int need_secure)
#endif
int
-fill_random_bytes(void *seed, size_t size, int need_secure)
+ruby_fill_random_bytes(void *seed, size_t size, int need_secure)
{
int ret = fill_random_bytes_syscall(seed, size, need_secure);
if (ret == 0) return ret;
return fill_random_bytes_urandom(seed, size);
}
+#define fill_random_bytes ruby_fill_random_bytes
+
static void
fill_random_seed(uint32_t *seed, size_t cnt)
{
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 0374744..84fd3ae 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -3913,7 +3913,7 @@ void
Init_vm_stack_canary(void)
{
/* This has to be called _after_ our PRNG is properly set up. */
- int n = fill_random_bytes(&vm_stack_canary, sizeof vm_stack_canary, false);
+ int n = ruby_fill_random_bytes(&vm_stack_canary, sizeof vm_stack_canary, false);
VM_ASSERT(n == 0);
}