From 5f9f3f373f2e4743ee92075185905ba9670e34fa Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 1 Jul 2020 10:54:06 +0200 Subject: [PATCH] cleanup: libc has 'getrandom' since 0.2.59 Signed-off-by: Wolfgang Bumiller --- proxmox/src/sys/linux.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/proxmox/src/sys/linux.rs b/proxmox/src/sys/linux.rs index 6d8dfd8f..9984051f 100644 --- a/proxmox/src/sys/linux.rs +++ b/proxmox/src/sys/linux.rs @@ -20,9 +20,8 @@ pub fn random_data(size: usize) -> Result, Error> { /// This code uses the Linux syscall getrandom() - see "man 2 getrandom". pub fn fill_with_random_data(buffer: &mut [u8]) -> Result<(), Error> { let res = unsafe { - libc::syscall( - libc::SYS_getrandom, - buffer.as_mut_ptr(), + libc::getrandom( + buffer.as_mut_ptr() as *mut libc::c_void, buffer.len() as libc::size_t, 0 as libc::c_uint, )