diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-12-28 23:25:29 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-12-28 23:25:29 +0100 |
commit | 909d32b5361eddda3a0db3586b1cb6598de7b620 (patch) | |
tree | cfc376069b0cf42b55b55e86c29f2189a8987062 /proc | |
parent | fd9a72c13f16177af489cc20a7f595beec155370 (diff) | |
download | hurd-909d32b5361eddda3a0db3586b1cb6598de7b620.tar.gz hurd-909d32b5361eddda3a0db3586b1cb6598de7b620.tar.bz2 hurd-909d32b5361eddda3a0db3586b1cb6598de7b620.zip |
proc: support waitid(WNOWAIT)
* proc/wait.c (S_proc_waitid): When options contains WNOWAIT, do not set
p_waited or complete child death.
Diffstat (limited to 'proc')
-rw-r--r-- | proc/wait.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/proc/wait.c b/proc/wait.c index 0f82240a..cea193d4 100644 --- a/proc/wait.c +++ b/proc/wait.c @@ -189,13 +189,19 @@ S_proc_waitid (struct proc *p, || !(child->p_traced || (options & WUNTRACED))) && (!child->p_continued || !(options & WCONTINUED)))) return 0; - child->p_waited = 1; + *status = child->p_status; *sigcode = child->p_sigcode; *ru = child->p_rusage; /* all zeros if !p_dead */ *pid_status = child->p_pid; - if (child->p_dead) - complete_exit (child); + + if (!(options & WNOWAIT)) + { + child->p_waited = 1; + if (child->p_dead) + complete_exit (child); + } + return 1; } |