From a990de90fe41456a23e58bd087d2f107d321f3a1 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Fri, 19 Jul 2024 16:37:58 +0400 Subject: Deleted vendor folder --- vendor/rustix/src/rand/getrandom.rs | 43 ------------------------------------- vendor/rustix/src/rand/mod.rs | 7 ------ 2 files changed, 50 deletions(-) delete mode 100644 vendor/rustix/src/rand/getrandom.rs delete mode 100644 vendor/rustix/src/rand/mod.rs (limited to 'vendor/rustix/src/rand') diff --git a/vendor/rustix/src/rand/getrandom.rs b/vendor/rustix/src/rand/getrandom.rs deleted file mode 100644 index c7f117a..0000000 --- a/vendor/rustix/src/rand/getrandom.rs +++ /dev/null @@ -1,43 +0,0 @@ -#![allow(unsafe_code)] - -use crate::buffer::split_init; -use crate::{backend, io}; -use core::mem::MaybeUninit; - -pub use backend::rand::types::GetRandomFlags; - -/// `getrandom(buf, flags)`—Reads a sequence of random bytes. -/// -/// This is a very low-level API which may be difficult to use correctly. Most -/// users should prefer to use [`getrandom`] or [`rand`] APIs instead. -/// -/// [`getrandom`]: https://crates.io/crates/getrandom -/// [`rand`]: https://crates.io/crates/rand -/// -/// # References -/// - [Linux] -/// -/// [Linux]: https://man7.org/linux/man-pages/man2/getrandom.2.html -#[inline] -pub fn getrandom(buf: &mut [u8], flags: GetRandomFlags) -> io::Result { - unsafe { backend::rand::syscalls::getrandom(buf.as_mut_ptr(), buf.len(), flags) } -} - -/// `getrandom(buf, flags)`—Reads a sequence of random bytes. -/// -/// This is identical to [`getrandom`], except that it can read into -/// uninitialized memory. It returns the slice that was initialized by this -/// function and the slice that remains uninitialized. -#[inline] -pub fn getrandom_uninit( - buf: &mut [MaybeUninit], - flags: GetRandomFlags, -) -> io::Result<(&mut [u8], &mut [MaybeUninit])> { - // Get number of initialized bytes. - let length = unsafe { - backend::rand::syscalls::getrandom(buf.as_mut_ptr() as *mut u8, buf.len(), flags) - }; - - // Split into the initialized and uninitialized portions. - Ok(unsafe { split_init(buf, length?) }) -} diff --git a/vendor/rustix/src/rand/mod.rs b/vendor/rustix/src/rand/mod.rs deleted file mode 100644 index ec4c112..0000000 --- a/vendor/rustix/src/rand/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -//! Random-related operations. - -#[cfg(linux_kernel)] -mod getrandom; - -#[cfg(linux_kernel)] -pub use getrandom::{getrandom, getrandom_uninit, GetRandomFlags}; -- cgit v1.2.3