in reply to Capturing Errors from Forked Processes

The result of a system call should be 0 if the command completed successfully. Otherwise, you need to examine (as you were doing) the $? variable to get the exit status of the script. See the documentation for system for information on how to make sense of this number (it does not immediately equal the exit status of the child process).

If you're trying to get the exit status of your child processes (after you fork), you need to examine $? after your wait or waitpid calls (when you reap your child processes).

If you're consistently getting -1 with system and $?, regardless of whether or not there was an error, I would say that's odd and that something is not as you say it is. Test your assumptions again.