# HG changeset patch # User Thien-Thi Nguyen # Date 1084106336 0 # Node ID 843ab503fee2398b02ed1145dad56952018f1567 # Parent 54d3f69203e5ad48493b3100cfa9351b8a2d87fa Initial revision diff -r 54d3f69203e5 -r 843ab503fee2 admin/notes/exit-value --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/admin/notes/exit-value Sun May 09 12:38:56 2004 +0000 @@ -0,0 +1,23 @@ +ttn 2004-05-09 + +The exit value of a program returning to the shell on unixoid systems is +typically 0 for success, and non-0 (such as 1) for failure. For vms it is +odd (1,3,5...) for success, even (0,2,4...) for failure. + +This holds from the point of view of the "shell" (in quotes because vms has a +different dispatch model that is not explained further here). + +From the point of view of the program, nowadays stdlib.h on both type of +systems provides macros `EXIT_SUCCESS' and `EXIT_FAILURE' that should DTRT. + +NB: The numerical values of these macros DO NOT need to fulfill the the exit +value requirements outlined in the first paragraph! That is the job of the +`exit' function. Thus, this kind of construct shows misunderstanding: + + #ifdef VMS + exit (1); + #else + exit (0); + #endif + +Values aside from EXIT_SUCCESS and EXIT_FAILURE are tricky.