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:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user