Re: RFC: error codes on exit
sysexits.h numbers are the same across all platforms which have it, I believe. I think it originated with Sendmail wanting to know a bit more about why any subprocesses exited.
On May 22, 2021 1:49:09 AM PDT, Junio C Hamano <gitster@pobox.com> wrote:
Show 43 quoted lines
>"H. Peter Anvin" <hpa@zytor.com> writes:
>
>> On 5/21/21 9:53 AM, Alex Henrie wrote:
>>> On Wed, May 19, 2021 at 6:40 PM Felipe Contreras
>>> <felipe.contreras@gmail.com> wrote:
>>>>
>>>> It's good to not include many initial codes, but I would start with
>at
>>>> least three:
>>>>
>>>> OK = 0,
>>>> UNKNOWN = 1,
>>>> NORMAL = 2,
>>> If you go that route, could you please pick a word other than
>>> "normal"
>>> to describe errors that are not entirely unexpected? I'm worried
>that
>>> someone will see "normal" and use it instead of "OK" to indicate
>>> success.
>>>
>>
>> <sysexits.h>
>
>Is the value assignment standardized across systems?
>
>We want human-readable names in the source to help developers while
>we want platform neutral output in the log so that log collectors
>can do some "intelligent" things about the output. If EX_USAGE is
>always 64 everywhere, that is great---we can emit "64" in the log
>and log collectors can take it as if they saw "EX_USAGE". But if
>the value assignment is platform-dependent, it does not help all
>that much.
>
> Side note. We had a similar discussion on <errno.h> and
> strerror(); the numbers do not help without knowing which
> platform the error came from, and strerror() output is localized
> and not suitable for machine consumption.
>
>In a sense, it is worse than we keep a central mapping between names
>programmers use to give to the new fatal() helper function and the
>string the tracing machinery will emit for these names.
>
>Thanks.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.