exit-codes-1.0.0: Exit codes as defined by BSD

Copyright (c) Justus Adam 2015 - 2018 BSD-3 dev@justus.science experimental POSIX Safe Haskell2010

System.Exit.Codes

Contents

Description

These are Haskell values generated by the C pre processor which expose exit codes as defined by the BSD project in "sysexits.h".

Please note that the values shown in the documentation are also inserted by the preprocessor and thus technically only valid for the platform this documentation was built on.

As may be evident from the structure here both the integer value for the exit code as well as the ExitCode value (to be used with exitWith) are exposed.

The format for a given code is:

EX_ERRORNAME
Error code CPP macro as defined by the sysexits.h header
exErrorName
Int value for the error
codeErrorName
ExitCode value for the error

The documentation snippets I copied from https://www.freebsd.org/cgi/man.cgi?query=sysexits&apropos=0&sektion=0&manpath=FreeBSD+4.3-RELEASE&format=html.

Synopsis

# Documentation

successful termination (0)

The successful exit is always indicated by a status of 0, or exOk.

successful termination (0)

command line usage error (64)

The command was used incorrectly, e.g., with the wrong number of arguments, a bad flag, a bad syntax in a parameter, or whatever.

command line usage error (64)

data format error (65)

The input data was incorrect in some way. This should only be used for user's data and not system files.

data format error (65)

cannot open input (66)

An input file (not a system file) did not exist or was not readable. This could also include errors like "No message" to a mailer (if it cared to catch it).

cannot open input (66)

The user specified did not exist. This might be used for mail addresses or remote logins.

host name unknown (68)

The host specified did not exist. This is used in mail addresses or network requests.

host name unknown (68)

service unavailable (69)

A service is unavailable. This can occur if a support program or file does not exist. This can also be used as a catchall message when something you wanted to do doesn't work, but you don't know why.

service unavailable (69)

internal software error (70)

An internal software error has been detected. This should be limited to non-operating system related errors as possible.

internal software error (70)

system error (71)

An operating system error has been detected. This is intended to be used for such things as "cannot fork", "cannot create pipe", or the like. It includes things like getuid returning a user that does not exist in the passwd file.

system error (71)

critical OS file missing (72)

Some system file (e.g., etcpasswd, varrun/utmp, etc.) does not exist, cannot be opened, or has some sort of error (e.g., syntax error).

critical OS file missing (72)

can't create (user) output file (73)

A (user specified) output file cannot be created.

can't create (user) output file (73)

input/output error (74)

An error occurred while doing I/O on some file.

input/output error (74)

temp failure; user is invited to retry (75)

Temporary failure, indicating something that is not really an error. In sendmail, this means that a mailer (e.g.) could not create a connection, and the request should be reattempted later.

temp failure; user is invited to retry (75)

remote error in protocol (76)

The remote system returned something that was "not possible" during a protocol exchange.

remote error in protocol (76)

permission denied (77)

You did not have sufficient permission to perform the operation. This is not intended for file system problems, which should use exNoInput or exNoPerm, but rather for higher level permissions.

permission denied (77)

configuration error (78)

Something was found in an unconfigured or misconfigured state.

configuration error (78)

# Bounds

base value for error messages (64)

Error numbers begin at exBase to reduce the possibility of clashing with other exit statuses that random programs may already return.

maximum listed value (78)