We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ad8410e + 92009af commit 0911a4eCopy full SHA for 0911a4e
src/rngs/os.rs
@@ -426,16 +426,13 @@ mod imp {
426
const NR_GETRANDOM: libc::c_long = 0;
427
428
fn getrandom(buf: &mut [u8], blocking: bool) -> libc::c_long {
429
- extern "C" {
430
- fn syscall(number: libc::c_long, ...) -> libc::c_long;
431
- }
432
const GRND_NONBLOCK: libc::c_uint = 0x0001;
433
434
if NR_GETRANDOM == 0 { return -1 };
435
436
unsafe {
437
- syscall(NR_GETRANDOM, buf.as_mut_ptr(), buf.len(),
438
- if blocking { 0 } else { GRND_NONBLOCK })
+ libc::syscall(NR_GETRANDOM, buf.as_mut_ptr(), buf.len(),
+ if blocking { 0 } else { GRND_NONBLOCK })
439
}
440
441
0 commit comments