wait4(): support for ECHILD error check
This commit is contained in:
@@ -276,6 +276,7 @@ SYSCALL_DECLARE(wait4)
|
|||||||
int options = (int)ihk_mc_syscall_arg2(ctx);
|
int options = (int)ihk_mc_syscall_arg2(ctx);
|
||||||
int ret;
|
int ret;
|
||||||
struct waitq_entry waitpid_wqe;
|
struct waitq_entry waitpid_wqe;
|
||||||
|
int empty = 1;
|
||||||
|
|
||||||
rescan:
|
rescan:
|
||||||
child = NULL;
|
child = NULL;
|
||||||
@@ -284,6 +285,9 @@ rescan:
|
|||||||
ihk_mc_spinlock_lock_noirq(&proc->ftn->lock);
|
ihk_mc_spinlock_lock_noirq(&proc->ftn->lock);
|
||||||
|
|
||||||
list_for_each_entry(child_iter, &proc->ftn->children, siblings_list) {
|
list_for_each_entry(child_iter, &proc->ftn->children, siblings_list) {
|
||||||
|
|
||||||
|
empty = 0;
|
||||||
|
|
||||||
ihk_mc_spinlock_lock_noirq(&child_iter->lock);
|
ihk_mc_spinlock_lock_noirq(&child_iter->lock);
|
||||||
|
|
||||||
if (child_iter->status == PS_ZOMBIE
|
if (child_iter->status == PS_ZOMBIE
|
||||||
@@ -296,6 +300,11 @@ rescan:
|
|||||||
ihk_mc_spinlock_unlock_noirq(&child_iter->lock);
|
ihk_mc_spinlock_unlock_noirq(&child_iter->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty) {
|
||||||
|
ihk_mc_spinlock_unlock_noirq(&proc->ftn->lock);
|
||||||
|
return ECHILD;
|
||||||
|
}
|
||||||
|
|
||||||
if (child) {
|
if (child) {
|
||||||
struct syscall_request request IHK_DMA_ALIGN;
|
struct syscall_request request IHK_DMA_ALIGN;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user