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.
This commit is contained in:
4lDO2
2023-06-26 19:48:26 +02:00
parent e34a3cee42
commit 829d2276fb
2 changed files with 2 additions and 16 deletions
-3
View File
@@ -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,
+2 -13
View File
@@ -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());
}
}