Skip to content
Snippets Groups Projects
Verified Commit 829d2276 authored by Jacob Lorentzon's avatar Jacob Lorentzon :speech_balloon:
Browse files

Remove Context::vfork.

Since clone is no longer exists as a syscall, it makes little sense to
manage vfork in the kernel. Implementing vfork in userspace would still
be possible.
parent e34a3cee
No related branches found
No related tags found
1 merge request!238Demand paging
......@@ -218,8 +218,6 @@ pub struct Context {
/// Tail buffer to use when system call buffers are not page aligned
// TODO: Store in user memory?
pub syscall_tail: Option<RaiiFrame>,
/// Context is halting parent
pub vfork: bool,
/// Context is being waited on
pub waitpid: Arc<WaitMap<WaitpidKey, (ContextId, usize)>>,
/// Context should handle pending signals
......@@ -292,7 +290,6 @@ impl Context {
syscall: None,
syscall_head: Some(RaiiFrame::allocate()?),
syscall_tail: Some(RaiiFrame::allocate()?),
vfork: false,
waitpid: Arc::new(WaitMap::new()),
pending: VecDeque::new(),
wake: None,
......
......@@ -112,24 +112,18 @@ pub fn exit(status: usize) -> ! {
let mut context = context_lock.write();
if context.ppid == pid {
context.ppid = ppid;
context.vfork = false;
}
}
}
let (vfork, children) = {
let children = {
let mut context = context_lock.write();
context = empty(&context_lock, context, false);
let vfork = context.vfork;
context.vfork = false;
context.status = context::Status::Exited(status);
let children = context.waitpid.receive_all();
(vfork, children)
context.waitpid.receive_all()
};
{
......@@ -137,9 +131,6 @@ pub fn exit(status: usize) -> ! {
if let Some(parent_lock) = contexts.get(ppid) {
let waitpid = {
let mut parent = parent_lock.write();
if vfork && ! parent.unblock() {
println!("{}: {} not blocked for exit vfork unblock", pid.into(), ppid.into());
}
Arc::clone(&parent.waitpid)
};
......@@ -151,8 +142,6 @@ pub fn exit(status: usize) -> ! {
pid: Some(pid),
pgid: Some(pgid)
}, (pid, status));
} else {
println!("{}: {} not found for exit vfork unblock", pid.into(), ppid.into());
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment