diff options
author | dzwdz | 2021-08-18 18:50:18 +0200 |
---|---|---|
committer | dzwdz | 2021-08-18 18:50:18 +0200 |
commit | 6a824d3a2184c6f9929dabf55930bd48fcb54323 (patch) | |
tree | 6ecdea1b2d93bcdb87c30ee0a2fafa89058363b4 /src/kernel | |
parent | baa4c5e085d81b2021b25adaba61d32e3f835a56 (diff) |
fork(): store information about the parent too
Diffstat (limited to 'src/kernel')
-rw-r--r-- | src/kernel/proc.c | 4 | ||||
-rw-r--r-- | src/kernel/proc.h | 1 |
2 files changed, 4 insertions, 1 deletions
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; diff --git a/src/kernel/proc.h b/src/kernel/proc.h index 05ab66a..f50ab33 100644 --- a/src/kernel/proc.h +++ b/src/kernel/proc.h @@ -14,6 +14,7 @@ struct process { struct process *sibling; struct process *child; + struct process *parent; }; extern struct process *process_first; |