diff --git a/internal.h b/internal.h index bfbd90bc5e..fec6d3c82f 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 d8cfd38016..fbcaccaedb 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 0374744756..84fd3aeb01 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); }