Contents

ExitStatus.exitCode(_:)

The process exited with the given exit code.

Declaration

case exitCode(CInt)

Parameters

  • exitCode:

    The exit code reported by the process.

Discussion

The C programming language defines two standard exit codes, EXIT_SUCCESS and EXIT_FAILURE. Platforms may additionally define their own non-standard exit codes:

Platform

Header

macOS

Exit.3, Sysexits.3

Linux

Exit.3, Sysexits.h.3head

FreeBSD

Man.cgi?exit(3), Man.cgi?sysexits(3)

OpenBSD

Exit, Sysexits

Windows

Exit Success Exit Failure

On macOS, FreeBSD, OpenBSD, and Windows, the full exit code reported by the process is reported to the parent process. Linux and other POSIX-like systems may only reliably report the low unsigned 8 bits (0–255) of the exit code.