summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-10-05 19:16:16 -0400
committerIan Moffett <ian@osmora.org>2025-10-05 19:16:16 -0400
commitf3563f62e0523c5dc9dcdf83e4ef3b6e4454f56f (patch)
tree8048c38f53831758c3593dbceb3b9201d139f910
parentb24533b63d5b2d90256625c4d2526f8822e593f1 (diff)
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 <ian@osmora.org>
-rw-r--r--src/sys/include/sys/proc.h13
1 files changed, 13 insertions, 0 deletions
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;