[PATCH] D138952: Support: Add polling option to sys::Wait [WIP]

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 06:34:17 PST 2022


aganea added inline comments.


================
Comment at: llvm/lib/Support/Unix/Program.inc:447
+          // Child's not done yet, resume it.
+          kill(PI.Pid, SIGCONT);
+        }
----------------
arsenm wrote:
> aganea wrote:
> > Out of curiosity (sorry I am not well versed into Linux APIs) -- who does stop the child process & when?
> Above a signal handler was installed. The process receives SIGALRM after the timeout from the OS. The original path here then killed off the child; this instead sends the signal to continue
The alarm signal/handler is received in the context of the parent process. The child process' state is unaffected by the alarm, right? I suppose the alarm has the effect to make `wait4()` return (from what I understand from the doc), but again, this doesn't affect the state of the child, does it? The child should be in a 'running' state at this point. So my question is, why do we need to send `SIGCONT` at all to the child?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138952/new/

https://reviews.llvm.org/D138952



More information about the llvm-commits mailing list