Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • by jhi (318) <> on 2004.02.02 12:12 (#27973) Homepage Journal
    > What is the "normal exit value of a process"? Without qualifying that, any documented success or error code can be deemed normal.

    • My guess was 0, though EXIT_SUCCESS would also be correct, right?

      I'm assuming you saw "process" and thought "function", which can indeed vary wildly.

      • > My guess was 0, though EXIT_SUCCESS would also be correct, right?

        Correct. There are many possible failures but only one possible success: EXIT_SUCCESS from , and in Unix/Linux EXIT_SUCCESS is defined to be zero. Easily testable in shell by:

        ls /none/such; echo $?
        ls /; echo $?

        • Except it didn't ask about a SUCCESS exit status, it asks for a NORMAL exit status. All documented failure and success return codes can be deemed normal. In this particular question even if you said EXIT_SUCCESS you would have been wrong.
        • What is the normal exit status of false?

          See, it's not so simple...
      • > I'm assuming you saw "process" and thought "function"

        Err... nope. Processes and functions are vastly different. A function can have any return value it feels like, whereas a process should have a known set of exit conditions and values.

        I've been writing both for quite sometime ;)

    • Why is that wrong? If a process fails with a 1 in a set of known conditions, why is that abnormal? The only abnormal exit values are ones returned from unknown exit conditions, such as a core dump.