in reply to Re: What is a successful return status for perl wait() in Solaris?
in thread What is a successful return status for perl wait() in Solaris?

Thanks for the information. So does 256 exit status means a successful exit of the child process? What happened is there is a bug in one of our program and the program will abort if $? >> 8 == 0. I can see if I terminate a child process, the exit status of wait is 0. But I thought the exit status of 0 means success, that's why I am a little bit confused.
  • Comment on Re^2: What is a successful return status for perl wait() in Solaris?

Replies are listed 'Best First'.
Re^3: What is a successful return status for perl wait() in Solaris?
by cdarke (Prior) on Feb 01, 2008 at 16:08 UTC
    So does 256 exit status means a successful exit of the child process?
    No, you cannot exit with 256 from UNIX, only 0-255. However, if you are talking about $?, that is a different matter. As others have said, $? contains many things other than just the return code. If the child process terminated because of a signal then the signal number is in $? as well.
    $exit_value = $? >> 8; $signal_num = $? & 127; $dumped_core = $? & 128;

    I think there has been some confusion over what you mean by an exit value.
      Does that mean waitpid() for a process id $pid forked by a fork command can expect a return code ( $? ) more than 255. I believe waitpid() should expect $? to be any value between 0-255 ( i. e. the child process (with $pid ) should always exit with a value between 0-255. ) Please clarify my doubt.
      So does exit value 256 means a successful exit?