assign the same TID and PID to the new process after fork()
This commit is contained in:
@@ -981,6 +981,9 @@ SYSCALL_DECLARE(clone)
|
|||||||
|
|
||||||
if (clone_flags & CLONE_VM) {
|
if (clone_flags & CLONE_VM) {
|
||||||
new->pid = cpu_local_var(current)->pid;
|
new->pid = cpu_local_var(current)->pid;
|
||||||
|
|
||||||
|
request1.number = __NR_gettid;
|
||||||
|
new->tid = do_syscall(&request1, &ctx1, cpuid, new->pid);
|
||||||
}
|
}
|
||||||
/* fork() a new process on the host */
|
/* fork() a new process on the host */
|
||||||
else {
|
else {
|
||||||
@@ -994,6 +997,9 @@ SYSCALL_DECLARE(clone)
|
|||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* In a single threaded process TID equals to PID */
|
||||||
|
new->tid = new->pid;
|
||||||
|
|
||||||
dkprintf("fork(): new pid: %d\n", new->pid);
|
dkprintf("fork(): new pid: %d\n", new->pid);
|
||||||
/* clear user space PTEs and set new rpgtable so that consequent
|
/* clear user space PTEs and set new rpgtable so that consequent
|
||||||
* page faults will look up the right mappings */
|
* page faults will look up the right mappings */
|
||||||
@@ -1012,9 +1018,6 @@ SYSCALL_DECLARE(clone)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
request1.number = __NR_gettid;
|
|
||||||
new->tid = do_syscall(&request1, &ctx1, cpuid, new->pid);
|
|
||||||
|
|
||||||
if (clone_flags & CLONE_PARENT_SETTID) {
|
if (clone_flags & CLONE_PARENT_SETTID) {
|
||||||
dkprintf("clone_flags & CLONE_PARENT_SETTID: 0x%lX\n",
|
dkprintf("clone_flags & CLONE_PARENT_SETTID: 0x%lX\n",
|
||||||
(unsigned long)ihk_mc_syscall_arg2(ctx));
|
(unsigned long)ihk_mc_syscall_arg2(ctx));
|
||||||
|
|||||||
Reference in New Issue
Block a user