mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 17:33:23 +00:00
Add syscall getrandom
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
3600a3a439
commit
5815f248fc
@ -1,9 +1,13 @@
|
||||
mod null;
|
||||
mod random;
|
||||
pub mod tty;
|
||||
mod urandom;
|
||||
mod zero;
|
||||
|
||||
use crate::fs::device::{add_node, Device, DeviceId, DeviceType};
|
||||
use crate::prelude::*;
|
||||
pub use random::Random;
|
||||
pub use urandom::Urandom;
|
||||
|
||||
/// Init the device node in fs, must be called after mounting rootfs.
|
||||
pub fn init() -> Result<()> {
|
||||
@ -14,5 +18,9 @@ pub fn init() -> Result<()> {
|
||||
tty::init();
|
||||
let tty = tty::get_n_tty().clone();
|
||||
add_node(tty, "tty")?;
|
||||
let random = Arc::new(random::Random);
|
||||
add_node(random, "random")?;
|
||||
let urandom = Arc::new(urandom::Urandom);
|
||||
add_node(urandom, "urandom")?;
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user