When we spawn sub processes, a lot of things can go wrong. We already report an error number back to the caller which is the errno of the failing system API. Often, but not always, this will be the errno of either a failed fork() or a failed exec(). However, other things may also go wrong, eg:
- failing to enter the designated current directory
- failing to close file descriptors before exec
- in posix_spawn mode, failing to spawn the jspawnhelper (see JDK8223777).
So it would be nice to have context information error number as well.