Issue ID: 16502
Summary: spawnProcess does not throw on exec errors
I chose Linux as OS for this issue, but it's legitimate for all Posix.
spawnProcess does not implement proper reporting of errors from exec.
This leads to the situations when execve fails, but spawnProcess does not
spawnProcess has some checks before fork, but these are not enough.
E.g. create empty file and mark it as executable
chmod +x notreallyexecutable
Then write D program:
void main(string args)
Compile and run:
It will not throw.
Error reporting can be implemented via pipe. Open pipe on parent side with
CLOEXEC. It will be inherited in fork. In case of exec errors write some code
to the pipe, e.g. errno code. On success pipe will be closed automatically.
On parent side read from pipe. In case of errors there will be errno code,