diff options
Diffstat (limited to 'vendor/rustix-0.36.5/src/backend/libc/rand')
-rw-r--r-- | vendor/rustix-0.36.5/src/backend/libc/rand/mod.rs | 2 | ||||
-rw-r--r-- | vendor/rustix-0.36.5/src/backend/libc/rand/syscalls.rs | 16 | ||||
-rw-r--r-- | vendor/rustix-0.36.5/src/backend/libc/rand/types.rs | 19 |
3 files changed, 0 insertions, 37 deletions
diff --git a/vendor/rustix-0.36.5/src/backend/libc/rand/mod.rs b/vendor/rustix-0.36.5/src/backend/libc/rand/mod.rs deleted file mode 100644 index 1e0181a99..000000000 --- a/vendor/rustix-0.36.5/src/backend/libc/rand/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub(crate) mod syscalls; -pub(crate) mod types; diff --git a/vendor/rustix-0.36.5/src/backend/libc/rand/syscalls.rs b/vendor/rustix-0.36.5/src/backend/libc/rand/syscalls.rs deleted file mode 100644 index 1c4286235..000000000 --- a/vendor/rustix-0.36.5/src/backend/libc/rand/syscalls.rs +++ /dev/null @@ -1,16 +0,0 @@ -//! libc syscalls supporting `rustix::rand`. - -#[cfg(target_os = "linux")] -use {super::super::c, super::super::conv::ret_ssize_t, crate::io, crate::rand::GetRandomFlags}; - -#[cfg(target_os = "linux")] -pub(crate) fn getrandom(buf: &mut [u8], flags: GetRandomFlags) -> io::Result<usize> { - // `getrandom` wasn't supported in glibc until 2.25. - weak_or_syscall! { - fn getrandom(buf: *mut c::c_void, buflen: c::size_t, flags: c::c_uint) via SYS_getrandom -> c::ssize_t - } - - let nread = - unsafe { ret_ssize_t(getrandom(buf.as_mut_ptr().cast(), buf.len(), flags.bits()))? }; - Ok(nread as usize) -} diff --git a/vendor/rustix-0.36.5/src/backend/libc/rand/types.rs b/vendor/rustix-0.36.5/src/backend/libc/rand/types.rs deleted file mode 100644 index 2ba3f1119..000000000 --- a/vendor/rustix-0.36.5/src/backend/libc/rand/types.rs +++ /dev/null @@ -1,19 +0,0 @@ -#[cfg(target_os = "linux")] -use super::super::c; -#[cfg(target_os = "linux")] -use bitflags::bitflags; - -#[cfg(target_os = "linux")] -bitflags! { - /// `GRND_*` flags for use with [`getrandom`]. - /// - /// [`getrandom`]: crate::rand::getrandom - pub struct GetRandomFlags: u32 { - /// `GRND_RANDOM` - const RANDOM = c::GRND_RANDOM; - /// `GRND_NONBLOCK` - const NONBLOCK = c::GRND_NONBLOCK; - /// `GRND_INSECURE` - const INSECURE = c::GRND_INSECURE; - } -} |