SYSEXITS(3)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

🌸 NAME 🌸

sysexits β€” legacy exit status codes for system programs.

Okay bestie, this is the SYSEXITS(3) page from the Library Functions Manual, and we're about to make these codes make sense. ✨


✨ SYNOPSIS ✨

#include <sysexits.h>

πŸ’… DESCRIPTION πŸ’…

Some commands attempt to describe the nature of a failure condition by using these pre-defined exit codes. Iconic in theory, but listen:

Deprecated alert, fr fr: this interface has been deprecated and is retained only for compatibility. Its use is discouraged. πŸ’€

πŸ”₯ ERRORS πŸ”₯

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

Error numbers begin at EX__BASE to reduce the possibility of clashing with other exit statuses that random programs may already return. The meaning of the codes is approximately as follows:

  • EX_USAGE (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. Basically: user error, bestie.
  • EX_DATAERR (65) β€” the input data was incorrect in some way. This should only be used for user's data and not system files.
  • EX_NOINPUT (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).
  • EX_NOUSER (67) β€” the user specified did not exist. This might be used for mail addresses or remote logins.
  • EX_NOHOST (68) β€” the host specified did not exist. This is used in mail addresses or network requests.
  • EX_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 does not work, but you do not know why. the β€œidk bestie it just didn't work” code
  • EX_SOFTWARE (70) β€” an internal software error has been detected. This should be limited to non-operating system related errors as possible.
  • EX_OSERR (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.
  • EX_OSFILE (72) β€” some system file (e.g., /etc/passwd, /var/run/utx.active, etc.) does not exist, cannot be opened, or has some sort of error (e.g., syntax error).
  • EX_CANTCREAT (73) β€” a (user specified) output file cannot be created.
  • EX_IOERR (74) β€” an error occurred while doing I/O on some file.
  • EX_TEMPFAIL (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.
  • EX_PROTOCOL (76) β€” the remote system returned something that was β€œnot possible” during a protocol exchange.
  • EX_NOPERM (77) β€” you did not have sufficient permission to perform the operation. This is not intended for file system problems, which should use EX_NOINPUT or EX_CANTCREAT, but rather for higher level permissions.
  • EX_CONFIG (78) β€” something was found in an unconfigured or misconfigured state.

The numerical values corresponding to the symbolical ones are given in parenthesis for easy reference. You're welcome πŸ’–


πŸ¦‹ SEE ALSO πŸ¦‹


πŸŽ€ HISTORY πŸŽ€

The sysexits file first appeared in 4BSD.


πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by JΓΆrg Wunsch.


πŸ’€ BUGS πŸ’€

This interface is not portable.

The choice of an appropriate exit value is often ambiguous. ngl, relatable


xoxo, this was the Debian SYSEXITS(3) page, dated May 9, 2024 β€” mwah πŸ’‹πŸ’…

πŸ“¦ where this page comes from