Correct init process, allow waiting on any children, reap zombies in init

This commit is contained in:
Jeremy Soller 2016-11-01 11:04:53 -06:00
parent ff227737bf
commit 25743a89a2
4 changed files with 122 additions and 46 deletions

View file

@ -7,7 +7,7 @@ use arch;
use context::file::File;
use context::memory::{Grant, Memory, SharedMemory, Tls};
use syscall::data::Event;
use sync::{WaitCondition, WaitQueue};
use sync::{WaitMap, WaitQueue};
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum Status {
@ -40,7 +40,7 @@ pub struct Context {
/// Context is halting parent
pub vfork: bool,
/// Context is being waited on
pub waitpid: Arc<WaitCondition>,
pub waitpid: Arc<WaitMap<usize, usize>>,
/// Context should wake up at specified time
pub wake: Option<(u64, u64)>,
/// The architecture specific context
@ -85,7 +85,7 @@ impl Context {
running: false,
cpu_id: None,
vfork: false,
waitpid: Arc::new(WaitCondition::new()),
waitpid: Arc::new(WaitMap::new()),
wake: None,
arch: arch::context::Context::new(),
kfx: None,