in reply to Net::OpenSSH with fork
Other system implementations (i.e. NetBSD) call sigprocmask(2) to disable delivering of CHLD signals inside the function, but I am not sure how portable that approach is. Does anybody have any experience using POSIX::sigprocmask() across different Unix/Linux OSs?
BTW, Perl builtins (system and qx()) do nothing to handle that case and also fail when $SIG{CHLD} is set to 'IGNORE' or to some funny handler reaping children.
update: at least on Linux, blocking SIGCHLD with sigprocmask(2) is not enough when the SA_NOCLDWAIT flag (aka $SIG{CHLD}='IGNORE') is set. The OS continues to reap dead children and waitpid fails.
|
|---|