Support pid of zero when calling waitpid

Make waitpid wait any process with the same pgid of the caller when
setting zero to the pid argument.
This commit is contained in:
Masamichi Takagi
2014-09-08 22:40:56 +09:00
parent ac40b96c24
commit b50e205a61
3 changed files with 9 additions and 1 deletions

View File

@ -183,6 +183,11 @@ do_setpgid(int pid, int pgid)
continue;
if(p->pid == pid){
p->pgid = pgid;
/* Update pgid in fork_tree because it's used in wait4 */
ihk_mc_spinlock_lock_noirq(&p->ftn->lock);
p->ftn->pgid = pgid;
ihk_mc_spinlock_unlock_noirq(&p->ftn->lock);
}
}
ihk_mc_spinlock_unlock(&(v->runq_lock), irqstate);