rustix 1.0.0

Safe Rust bindings to POSIX/Unix/Linux/Winsock-like syscalls
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! linux_raw syscalls supporting `rustix::rand`.
//!
//! # Safety
//!
//! See the `rustix::backend` module documentation for details.
#![allow(unsafe_code, clippy::undocumented_unsafe_blocks)]

use crate::backend::conv::{pass_usize, ret_usize};
use crate::io;
use crate::rand::GetRandomFlags;

#[inline]
pub(crate) unsafe fn getrandom(buf: (*mut u8, usize), flags: GetRandomFlags) -> io::Result<usize> {
    ret_usize(syscall!(__NR_getrandom, buf.0, pass_usize(buf.1), flags))
}