Merge branch 'sys-random-docs' into 'master'

Add docs for sys/random.h

See merge request redox-os/relibc!553
This commit is contained in:
Jeremy Soller
2024-11-17 16:13:17 +00:00
+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(