mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
random.c: prefixed fill_random_bytes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
db40f67849
commit
6f7fafbf00
3 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
4
random.c
4
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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue