Add docs for sys/random.h

This commit is contained in:
Peter Limkilde Svendsen
2024-11-09 18:12:58 +01:00
parent a45c7b26d9
commit 0090dea50f
+7
View File
@@ -1,3 +1,7 @@
//! `sys/random.h` implementation.
//!
//! Non-POSIX, see <https://www.man7.org/linux/man-pages/man2/getrandom.2.html>.
use core::slice;
use crate::{
@@ -5,9 +9,12 @@ use crate::{
platform::{types::*, Pal, Sys},
};
/// See <https://www.man7.org/linux/man-pages/man2/getrandom.2.html>.
pub const GRND_NONBLOCK: c_uint = 1;
/// See <https://www.man7.org/linux/man-pages/man2/getrandom.2.html>.
pub const GRND_RANDOM: c_uint = 2;
/// See <https://www.man7.org/linux/man-pages/man2/getrandom.2.html>.
#[no_mangle]
pub unsafe extern "C" fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t {
Sys::getrandom(