Skip to content

Commit dccfc46

Browse files
committed
Replace raw 'libc::syscall' with 'libc::getrandom'
1 parent c4496bd commit dccfc46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/linux_android.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub fn getrandom_inner(dest: &mut [u8]) -> Result<(), Error> {
1515
static HAS_GETRANDOM: LazyBool = LazyBool::new();
1616
if HAS_GETRANDOM.unsync_init(is_getrandom_available) {
1717
sys_fill_exact(dest, |buf| unsafe {
18-
libc::syscall(libc::SYS_getrandom,
18+
libc::getrandom(
1919
buf.as_mut_ptr() as *mut libc::c_void,
2020
buf.len() as libc::size_t,
2121
0 as libc::c_uint) as libc::ssize_t
@@ -26,7 +26,7 @@ pub fn getrandom_inner(dest: &mut [u8]) -> Result<(), Error> {
2626
}
2727

2828
fn is_getrandom_available() -> bool {
29-
let res = unsafe { libc::syscall(libc::SYS_getrandom,
29+
let res = unsafe { libc::getrandom(
3030
0 as *mut libc::c_void,
3131
0 as libc::size_t,
3232
libc::GRND_NONBLOCK as libc::c_uint) };

0 commit comments

Comments
 (0)