79741599

Date: 2025-08-20 21:26:51
Score: 1.5
Natty:
Report link

Just a hint for anyone still having the same issue. If the circumstances of process death aren't important (exit code and/or signal) there is work around. One can detect a process death by secondary indicators. One can rely on the *nix feature that guarantees that on exit each process closes all of its descriptors. Knowing this one can create a simple pipe, where each end is shared by each party.

Then, a simple select on one end of the pipe will detect an event of the other end being closed (process exit). It's very common in this case to already have some communication line between parent and child (stdin/stdout/strderr or a custom pipe/unix-socket). In which case this is all that is needed here.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Me too answer (2.5): having the same issue
  • High reputation (-1):
Posted by: GreenScape