summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-05-15 17:41:29 -0400
committerIan Moffett <ian@osmora.org>2025-05-15 18:01:30 -0400
commit02ca8f9faf6b6ddd0b7a514503b223e9ecbe8fe9 (patch)
tree905c09181f3ac1026b6d800c9151af527753665e /sys/include
parent7c40f732d616a7a2bd005c51ca86d609c2dc4788 (diff)
kernel: proc: Do not introduce fork()main
Simplicity is divine, fork() may be powerful but is no longer simple. It became a thing in the late 70s during the early days of UNIX when computing was simple, when CPUs were only 16-bits, MMUs were not prevalent and RAM was only 512 KB. However it isn't 1971 anymore, process management, CPUs and memory architecture has advanced significantly since. This commit ceases work on the fork() syscall as implementing it would only introduce unnecessary complexity, security issues, hefty processing overhead and would perpetuate what should now be considered legacy. The current best alternative would be providing a form of process spawning as well as a mechanism to wait for the child process to complete. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/proc.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/include/sys/proc.h b/sys/include/sys/proc.h
index c561e91..d252ab7 100644
--- a/sys/include/sys/proc.h
+++ b/sys/include/sys/proc.h
@@ -76,7 +76,8 @@ struct proc {
#define PROC_EXEC BIT(1) /* Exec called (cleared by sched) */
struct proc *this_td(void);
-int md_fork(struct proc *p, struct proc *parent, uintptr_t ip);
+int md_spawn(struct proc *p, struct proc *parent, uintptr_t ip);
+int spawn(struct proc *cur, int flags, void(*ip)(void), struct proc **newprocp);
void md_td_stackinit(struct proc *td, void *stack_top, struct exec_prog *prog);
__dead void md_td_kick(struct proc *td);