Subject: | Set $! after exec() failure? |
Date: | Mon, 29 Oct 2018 15:13:20 -0400 |
To: | bug-Proc-FastSpawn [...] rt.cpan.org |
From: | Felipe Gasper <felipe [...] felipegasper.com> |
Hello,
I’ve got a patch that sets $! when the child process’s execve() fails. This, of course, strictly speaking violates the vfork documentation (which mandates that nothing happen between vfork and either successful execve or exit), but it will allow detection in the parent of execve() failure, which is hugely valuable:
- If !$pid: $! is vfork() error
- If !!$pid but $!: $! is execve() error
It seems to work in my testing; what do you think?
Thanks for your time!
-Felipe Gasper
Mississauga, Ontario