rsix 0.23.4

Safe Rust ("rs") bindings to POSIX-like/Unix-like/Linux ("ix") syscalls
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::{imp, io};

/// `GRND_*`
pub use imp::rand::GetRandomFlags;

/// `getrandom(buf, flags)`—Reads a sequence of random bytes.
///
/// # 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> {
    imp::syscalls::getrandom(buf, flags)
}