From 6a824d3a2184c6f9929dabf55930bd48fcb54323 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Wed, 18 Aug 2021 18:50:18 +0200 Subject: fork(): store information about the parent too --- src/kernel/proc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/kernel/proc.c') diff --git a/src/kernel/proc.c b/src/kernel/proc.c index 02826d8..eea651f 100644 --- a/src/kernel/proc.c +++ b/src/kernel/proc.c @@ -12,7 +12,8 @@ struct process *process_seed() { proc->pages = pagedir_new(); proc->state = PS_RUNNING; proc->sibling = NULL; - proc->child = NULL; + proc->child = NULL; + proc->parent = NULL; process_first = proc; @@ -37,6 +38,7 @@ struct process *process_fork(struct process *parent) { child->pages = pagedir_copy(parent->pages); child->sibling = parent->child; child->child = NULL; + child->parent = parent; parent->child = child; return child; -- cgit v1.2.3