git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: RFC: error codes on exit

From
HAH. Peter Anvin <hpa@zytor.com>
Date
May 22, 2021, 09:08 UTC
Message-ID
<357C5DA0-6A1B-4A69-8BBD-5D12327C136A@zytor.com>
In-Reply-To
<xmqqfsyfqhkq.fsf@gitster.g>
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.
Previous: Junio C HamanoNext: Felipe Contreras
Message 7 of 26 in “RFC: error codes on exit”
  1. Jonathan NiederMay 19, 2021
  2. Felipe ContrerasMay 20, 2021
  3. Alex HenrieMay 21, 2021
  4. H. Peter AnvinMay 21, 2021
  5. Bagas SanjayaMay 22, 2021
  6. Junio C HamanoMay 22, 2021
  7. H. Peter AnvinMay 22, 2021
  8. Felipe ContrerasMay 22, 2021
  9. H. Peter AnvinMay 22, 2021
  10. Felipe ContrerasMay 22, 2021
  11. H. Peter AnvinMay 22, 2021
  12. Philip OakleyMay 22, 2021
  13. Felipe ContrerasMay 22, 2021
  14. Alex HenrieMay 25, 2021
  15. Felipe ContrerasMay 25, 2021
  16. Junio C HamanoMay 20, 2021
  17. Felipe ContrerasMay 20, 2021
  18. Jonathan NiederMay 20, 2021
  19. Junio C HamanoMay 20, 2021
  20. Jeff KingMay 20, 2021
  21. Jonathan NiederMay 20, 2021
  22. Jeff KingMay 21, 2021
  23. Jeff HostetlerMay 20, 2021
  24. brian m. carlsonMay 21, 2021
  25. brian m. carlsonMay 21, 2021
  26. Ævar Arnfjörð BjarmasonMay 26, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.