check CLONE_VM in clone_flags for determining whether clone()/fork() is requested

This commit is contained in:
Balazs Gerofi bgerofi@riken.jp
2014-04-11 15:41:17 +09:00
parent 55817e9e83
commit b93db2411c
2 changed files with 20 additions and 22 deletions

View File

@ -979,9 +979,11 @@ SYSCALL_DECLARE(clone)
return -ENOMEM;
}
if (clone_flags & CLONE_VM) {
new->pid = cpu_local_var(current)->pid;
}
/* fork() a new process on the host */
/* TODO: do this check properly! */
if (clone_flags == 0x1200011) {
else {
request1.number = __NR_fork;
new->pid = do_syscall(&request1, &ctx1, ihk_mc_get_processor_id(), 0);
@ -1009,9 +1011,6 @@ SYSCALL_DECLARE(clone)
kprintf("ERROR: clearing PTEs in host process\n");
}
}
else {
new->pid = cpu_local_var(current)->pid;
}
request1.number = __NR_gettid;
new->tid = do_syscall(&request1, &ctx1, cpuid, new->pid);