git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix missing locks in the vfs subsystem
[lunaix-os.git]
/
lunaix-os
/
kernel
/
process
/
fork.c
diff --git
a/lunaix-os/kernel/process/fork.c
b/lunaix-os/kernel/process/fork.c
index 9f257aa72b73c22d7af6c4e6581d6f4e1d760531..d68a8f830d3768553d66f97ef2599dabfcdf255b 100644
(file)
--- a/
lunaix-os/kernel/process/fork.c
+++ b/
lunaix-os/kernel/process/fork.c
@@
-10,8
+10,8
@@
#include <lunaix/signal.h>
#include <lunaix/kpreempt.h>
#include <lunaix/signal.h>
#include <lunaix/kpreempt.h>
-#include <
sys
/abi.h>
-#include <
sys/m
m/mm_defs.h>
+#include <
asm
/abi.h>
+#include <
as
m/mm_defs.h>
#include <klibc/string.h>
#include <klibc/string.h>
@@
-45,18
+45,6
@@
region_maybe_cow(struct mm_region* region)
tlb_flush_vmr_all(region);
}
tlb_flush_vmr_all(region);
}
-static inline void
-__dup_fdtable(struct proc_info* pcb)
-{
- for (size_t i = 0; i < VFS_MAX_FD; i++) {
- struct v_fd* fd = __current->fdtable->fds[i];
- if (!fd)
- continue;
- vfs_dup_fd(fd, &pcb->fdtable->fds[i]);
- }
-}
-
-
static void
__dup_kernel_stack(struct thread* thread, ptr_t vm_mnt)
{
static void
__dup_kernel_stack(struct thread* thread, ptr_t vm_mnt)
{
@@
-172,7
+160,8
@@
dup_proc()
vfs_ref_dnode(pcb->cwd);
}
vfs_ref_dnode(pcb->cwd);
}
- __dup_fdtable(pcb);
+ fdtable_copy(pcb->fdtable, __current->fdtable);
+ uscope_copy(&pcb->uscope, current_user_scope());
struct proc_mm* mm = vmspace(pcb);
procvm_dupvms_mount(mm);
struct proc_mm* mm = vmspace(pcb);
procvm_dupvms_mount(mm);