As far as I understand if the main function returns 0 this indicates always successful program termination. Even if success is indicated by another int value.
If main returns a non-zero value it is implementation specific if this stands for unsuccessful program termination or another error code
If the value of
status
is zero orEXIT_SUCCESS
, an implementation-defined form of the status successful termination is returned. If the value ofstatus
isEXIT_FAILURE
, an implementation-defined form of the status unsuccessful termination is returned. Otherwise the status returned is implementation-defined.)
So only success is defined in the C standard (return 0) and not how a non-zero int value is interpreted, right? E.g. if in a certain system 1 stands for "success" return 0 would be deliver 1 as well? How is this done?