Post by Joe BarrettPost by Paul MazzuccoIf the exitCodes are enabled within the shell, what value are we to
print if the command included an '&'? Or, are we not to print any
exit code in the case of an amperstand?
The only time the shell would know how to report an exit code is if it
waits for the process to exit (unless the shell implements job control
[which this shell does not]). If the shell is running as a background
process, it shouldn't report an exit code for the process, because it
won't have any way of knowing when/if it exists.
That's correct, so feel free to ignore the
if (exitCodes)
test if the process is spawned in background. The Unix shell can do this
because the wait() system call in Unix supports wildcard waiting, i.e.
wait for *any child* to finish, not for one with a specific PID.
The GeekOS Wait() syscall is not that powerful.
Type 'man 2 wait' if you want to find out more.
Iulian