mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-21 16:10:47 +00:00
cleanup: libc has 'getrandom' since 0.2.59
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
2b6b94dd3a
commit
5f9f3f373f
@ -20,9 +20,8 @@ pub fn random_data(size: usize) -> Result<Vec<u8>, Error> {
|
|||||||
/// This code uses the Linux syscall getrandom() - see "man 2 getrandom".
|
/// This code uses the Linux syscall getrandom() - see "man 2 getrandom".
|
||||||
pub fn fill_with_random_data(buffer: &mut [u8]) -> Result<(), Error> {
|
pub fn fill_with_random_data(buffer: &mut [u8]) -> Result<(), Error> {
|
||||||
let res = unsafe {
|
let res = unsafe {
|
||||||
libc::syscall(
|
libc::getrandom(
|
||||||
libc::SYS_getrandom,
|
buffer.as_mut_ptr() as *mut libc::c_void,
|
||||||
buffer.as_mut_ptr(),
|
|
||||||
buffer.len() as libc::size_t,
|
buffer.len() as libc::size_t,
|
||||||
0 as libc::c_uint,
|
0 as libc::c_uint,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user