If the value of string is NULL, system() returns nonzero if the shell is available, and zero if not.
system() does not affect the wait status of any other children.
Do not use system() from a program with suid or sgid privileges, because strange values for some environment variables might be used to subvert system integrity. Use the exec(2) family of functions instead, but not execlp(2) or execvp(2).
The check for the availability of /bin/sh is not actually performed; it is always assumed to be available.
It is possible for the shell command to return 127, so that code is not a sure indication that the execve() call failed; check errno to make sure.