fix: the correct way to detect ahci LBA48 support
[lunaix-os.git] / lunaix-os / kernel / process / process.c
index e30e46120a21b4e213c4087d10f158cc7352ca99..74c93807f57115ac85f582d60c5acdd58996d313 100644 (file)
@@ -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) {
+    if (!gruppenfuhrer || proc->pgid == gruppenfuhrer->pid) {
         __current->k_status = EINVAL;
         return -1;
     }
@@ -196,6 +196,13 @@ dup_proc()
     pcb->intr_ctx = __current->intr_ctx;
     pcb->parent = __current;
 
+    memcpy(pcb->fxstate, __current->fxstate, 512);
+
+    if (__current->cwd) {
+        pcb->cwd = __current->cwd;
+        vfs_ref_dnode(pcb->cwd);
+    }
+
     __copy_fdtable(pcb);
     region_copy(&__current->mm.regions, &pcb->mm.regions);