From f3563f62e0523c5dc9dcdf83e4ef3b6e4454f56f Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 5 Oct 2025 19:16:16 -0400 Subject: kern: proc: Add process environment block Introduce a process environment block structure to pass information such as arguments, argument counts, etc to the process during startup without having to make a mess on the stack Signed-off-by: Ian Moffett --- src/sys/include/sys/proc.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/sys/include/sys/proc.h b/src/sys/include/sys/proc.h index c268693..d93f490 100644 --- a/src/sys/include/sys/proc.h +++ b/src/sys/include/sys/proc.h @@ -49,6 +49,17 @@ #define STACK_LEN 4096 #if defined(_KERNEL) + +/* + * Process environment block, used to store arguments + * and other information. + * + * @pid: PID of the process that owns this block + */ +struct penv_blk { + pid_t pid; +}; + /* * A process describes a running program image * on the system. @@ -57,6 +68,7 @@ * @flags: State flags (see PROC_*) * @pcb: Process control block * @scdom: Syscall domain + * @envblk: Environment block * @level: Access level * @maplist_lock: Protects the maplist * @sigtab: Signal table @@ -69,6 +81,7 @@ struct proc { struct md_pcb pcb; struct syscall_domain scdom; struct filedesc *fdtab[FD_MAX]; + struct penv_blk envblk; mac_level_t level; struct spinlock maplist_lock; sigtab_t sigtab; -- cgit v1.2.3