aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / vendor / getrandom / src / fuchsia.rs
| 1 | //! Implementation for Fuchsia Zircon |
| 2 | use crate::Error; |
| 3 | use core::mem::MaybeUninit; |
| 4 | |
| 5 | #[link(name = "zircon")] |
| 6 | extern "C" { |
| 7 | fn zx_cprng_draw(buffer: *mut u8, length: usize); |
| 8 | } |
| 9 | |
| 10 | pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> { |
| 11 | unsafe { zx_cprng_draw(dest.as_mut_ptr() as *mut u8, dest.len()) } |
| 12 | Ok(()) |
| 13 | } |