Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9434

Process exit codes should be between 0 and 255

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: Admin
    • Labels:
      None
    • Environment:
      Affects all platforms; most visible as a difference between Windows and UNIX-style OSes
    • Major Change
    • Execution Team 2022-06-27, Execution Team 2022-07-11
    • 70

      According to the various standards governing Unix-y systems, only the low-order 8 bits of exit codes are returned to parent processes, meaning that parent processes only see exit code values between 0 and 255.

      Several MongoDB executables use negative numbers for error exit codes, so _exit(-3) shows up in the shell as exit code 253.

      Windows does not follow this convention, so _exit(-3) shows an exit code of -3.

      It would enhance cross-platform compatibility and assist documentation if exit codes were restricted to values that will work on all platforms.

            Assignee:
            matt.kneiser@mongodb.com Matt Kneiser
            Reporter:
            tad Tad Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: