From fe6be93d3250dc4790bbe247550efcc7190cbba6 Mon Sep 17 00:00:00 2001 From: Chloe M Date: Tue, 14 Jul 2026 15:54:23 -0400 Subject: [PATCH] ptos: ps: Keep track of parent process Signed-off-by: Chloe M --- service/ptos/head/ps/thread.h | 2 ++ service/ptos/ps/thread.c | 1 + 2 files changed, 3 insertions(+) diff --git a/service/ptos/head/ps/thread.h b/service/ptos/head/ps/thread.h index ee121a9..70abab0 100644 --- a/service/ptos/head/ps/thread.h +++ b/service/ptos/head/ps/thread.h @@ -22,10 +22,12 @@ struct _PROCESS; * processes. * * @Tid: Thread ID + * @Parent: Parent process * @ThreadLink: Thread queue link */ typedef struct _THREAD { UQUAD Tid; + struct _PROCESS *Parent; TAILQ_ENTRY(_THREAD) ThreadLink; } THREAD; diff --git a/service/ptos/ps/thread.c b/service/ptos/ps/thread.c index 9e30397..1cf3abb 100644 --- a/service/ptos/ps/thread.c +++ b/service/ptos/ps/thread.c @@ -34,6 +34,7 @@ PsCreateThread(struct _PROCESS *Parent, ULONG Flags, THREAD **Result) } Thread->Tid = AtomicIncQuad(&NextThreadTid); + Thread->Parent = Parent; *Result = Thread; return STATUS_SUCCESS; }