The only standard values for these are 0, EXIT_SUCCESS and EXIT_FAILURE.
Zero is the same as EXIT_SUCCESS. For using any other values (like
1, -1 etc.) you'll have to seek the guarantees of standards beyond ISO
C.
No such standard behaviour is specified by ISO C. Each system might have
it's own standardised or semi-standard behaviour. The portability of C
code in your example will not be affected because a return of zero
always means successful termination and the C library is obliged to
translate this to whatever code that the system uses for successful
termination. Thus if for the underlying system 10 indicates successful
termination and you return zero, the C library will actually return 10.
It will do the same for a return of EXIT_SUCCESS too. A recompile for
each platform will ensure correct behaviour.
From the standard ISO/IEC 9899:1999 (E) we have this:
"5.1.2.2.3 Program termination
1 If the return type of the main function is a type compatible with
int, a return from the initial call to the main function is equivalent
to calling the exit function with the value returned by the main
function as its argument;10) reaching the } that terminates the main
function returns a value of 0. If the return type is not compatible
with int, the termination status returned to the host environment is
unspecified.
Forward references: definition of terms (7.1.1), the exit function
(7.20.4.3)."
And this:
"7.20.4.3 The exit function
Synopsis
1 #include <stdlib.h>
void exit(int status);
Description
2 The exit function causes normal program termination to occur. If
more than one call to the exit function is executed by a program, the
behavior is undefined.
3 First, all functions registered by the atexit function are called,
in the reverse order of their registration,253) except that a function
is called after any previously registered functions that had already
been called at the time it was registered. If, during the call to any
such function, a call to the longjmp function is made that would
terminate the call to the registered function, the behavior is
undefined.
4 Next, all open streams with unwritten buffered data are flushed, all
open streams are closed, and all files created by the tmpfile function
are removed.
5 Finally, control is returned to the host environment. If the value
of status is zero or EXIT_SUCCESS, an implementation-defined form of
the status successful termination is returned. If the value of status
is EXIT_FAILURE, an implementation-defined form of the status
unsuccessful termination is returned. Otherwise the status returned is
implementation-defined.
Returns
6 The exit function cannot return to its caller."
So we can conclude that return 0 or return EXIT_SUCCESS will return
successful status and that return EXIT_FAILURE will return
unsuccessful status and that any other value must be implementation
defined.