Sha256: 7ad1be6a5b0dc25030bb2434bdc00f3a0c410b7ebc24c136b9839410bf6c5a97

Contents?: true

Size: 657 Bytes

Versions: 8

Compression:

Stored size: 657 Bytes

Contents

use crate::{backend, io};

/// `GRND_*`
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<usize> {
    backend::rand::syscalls::getrandom(buf, flags)
}

Version data entries

8 entries across 7 versions & 1 rubygems

Version Path
wasmtime-8.0.0 ./ext/cargo-vendor/rustix-0.36.12/src/rand/getrandom.rs
wasmtime-7.0.0 ./ext/cargo-vendor/rustix-0.36.11/src/rand/getrandom.rs
wasmtime-7.0.0 ./ext/cargo-vendor/rustix-0.37.5/src/rand/getrandom.rs
wasmtime-6.0.1 ./ext/cargo-vendor/rustix-0.36.8/src/rand/getrandom.rs
wasmtime-6.0.0 ./ext/cargo-vendor/rustix-0.36.8/src/rand/getrandom.rs
wasmtime-5.0.0 ./ext/cargo-vendor/rustix-0.36.7/src/rand/getrandom.rs
wasmtime-0.4.1 ./ext/cargo-vendor/rustix-0.36.5/src/rand/getrandom.rs
wasmtime-0.4.0 ./ext/cargo-vendor/rustix-0.36.5/src/rand/getrandom.rs