ExitCode

public struct ExitCode { /* private fields */ }

A process exit code.

Conventionally 0 means success and any non-zero value means failure. Only the low 8 bits survive on POSIX (WEXITSTATUS), so the meaningful range is 0255. The byte is private; build one with ExitCode(_:) or use the .success / .failure constants.

Properties

public static var failure: ExitCode { get }

The conventional generic-failure code, 1.

public static var success: ExitCode { get }

The conventional success code, 0.

Initializers

public init(UInt8)

Builds an exit code from a byte. exit(-1)-style codes are spelled ExitCode(255).

ImplementsExitable

Methods

consuming func report() -> ExitCode

Defined in lang/std/os/exitable.ks