From 4286b14839c0c4ec016d816e426660f6685ae349 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 7 May 2020 18:10:22 +0200 Subject: Fixed many bugs with wait() and fork() This also adds many race conditions which really need to be fixed.. --- src/kernel/syscall/actions/sys_fork.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/kernel/syscall/actions/sys_fork.c') diff --git a/src/kernel/syscall/actions/sys_fork.c b/src/kernel/syscall/actions/sys_fork.c index f0a5711..084659e 100644 --- a/src/kernel/syscall/actions/sys_fork.c +++ b/src/kernel/syscall/actions/sys_fork.c @@ -4,16 +4,19 @@ #include #include #include +#include u32 sys_fork(struct regs *r) { + cli(); struct page_directory *dir = paging_copy_user_directory(current_proc->cr3); struct process *proc = process_make_new(); proc->cr3 = dir; memcpy(&proc->registers, r, sizeof(struct regs)); proc->registers.eax = proc->pid; - proc->pid = current_proc->pid; + proc->pid = current_proc->pid + 1; + sti(); process_spawn(proc); return 0; -- cgit v1.2.3