in reply to Re^2: Reading return value from C program
in thread Reading return value from C program

agianni's code wouldn't make sense after a fork(), that's true. It would make sense after a waitpid. Maybe that was the tacit assumption. It would have been better made explicit.

Anno

Replies are listed 'Best First'.
Re^4: Reading return value from C program
by ikegami (Patriarch) on Mar 15, 2007 at 19:08 UTC

    Even after waitpid, $? doesn't indicate whether the child was launched successfully or not. $? indicates whether the child *ended* successfully.

      Sorry for the lack of clarity, do the updated comments better reflect the meaning of $?