feat: hook up the keyboard input into our vfs
[lunaix-os.git] / lunaix-os / kernel / process.c
index a783efe13987a6a2b1c46fd932d67b863314b594..4d6a77ee2f7a5f2ea5ba3ea7617d543c04a626e8 100644 (file)
@@ -114,7 +114,7 @@ __DEFINE_LXSYSCALL2(int, setpgid, pid_t, pid, pid_t, pgid)
     struct proc_info* proc = pid ? get_process(pid) : __current;
 
     if (!proc) {
     struct proc_info* proc = pid ? get_process(pid) : __current;
 
     if (!proc) {
-        __current->k_status = LXINVL;
+        __current->k_status = EINVAL;
         return -1;
     }
 
         return -1;
     }
 
@@ -123,7 +123,7 @@ __DEFINE_LXSYSCALL2(int, setpgid, pid_t, pid, pid_t, pgid)
     struct proc_info* gruppenfuhrer = get_process(pgid);
 
     if (!gruppenfuhrer || proc->pgid == proc->pid) {
     struct proc_info* gruppenfuhrer = get_process(pgid);
 
     if (!gruppenfuhrer || proc->pgid == proc->pid) {
-        __current->k_status = LXINVL;
+        __current->k_status = EINVAL;
         return -1;
     }
 
         return -1;
     }
 
@@ -184,6 +184,7 @@ dup_proc()
     pcb->intr_ctx = __current->intr_ctx;
     pcb->parent = __current;
 
     pcb->intr_ctx = __current->intr_ctx;
     pcb->parent = __current;
 
+    memcpy(pcb->fdtable, __current->fdtable, sizeof(struct v_fdtable));
     region_copy(&__current->mm.regions, &pcb->mm.regions);
 
     setup_proc_mem(pcb, PD_REFERENCED);
     region_copy(&__current->mm.regions, &pcb->mm.regions);
 
     setup_proc_mem(pcb, PD_REFERENCED);