From c178ab5d5ca328d5b0072d54e3dc66d1b198df7b Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sun, 8 Jan 2023 21:14:03 +0100 Subject: kernel: let parents kill their children again --- src/kernel/proc.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/kernel/proc.h') diff --git a/src/kernel/proc.h b/src/kernel/proc.h index 135baad..fa50520 100644 --- a/src/kernel/proc.h +++ b/src/kernel/proc.h @@ -9,6 +9,7 @@ struct vfs_mount; /* legal transitions described by process_transition */ enum process_state { PS_RUNNING, + PS_DYING, /* during process_kill - mostly treated as alive */ PS_TOREAP, /* return message not collected */ PS_TOMBSTONE, /* fully dead, supports alive children */ @@ -85,7 +86,10 @@ struct process *process_seed(void *data, size_t datalen); struct process *process_fork(struct process *parent, int flags); void process_kill(struct process *proc, int ret); -/** Tries to reap a dead process / free a tombstone. */ +/** Kills all descendants. */ +void process_filicide(struct process *proc, int ret); +/** Tries to reap a dead process / free a tombstone. + * Can also free all dead parents of *dead. Be careful. */ void process_tryreap(struct process *dead); /** Switches execution to any running process. */ -- cgit v1.2.3