xref: /original-bsd/include/sysexits.h (revision e718337e)
1 /*
2  * Copyright (c) 1987 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)sysexits.h	4.7 (Berkeley) 10/15/90
8  */
9 
10 /*
11 **  SYSEXITS.H -- Exit status codes for system programs.
12 **
13 **	This include file attempts to categorize possible error
14 **	exit statuses for system programs, notably delivermail
15 **	and the Berkeley network.
16 **
17 **	Error numbers begin at EX__BASE to reduce the possibility of
18 **	clashing with other exit statuses that random programs may
19 **	already return.  The meaning of the codes is approximately
20 **	as follows:
21 **
22 **	EX_USAGE -- The command was used incorrectly, e.g., with
23 **		the wrong number of arguments, a bad flag, a bad
24 **		syntax in a parameter, or whatever.
25 **	EX_DATAERR -- The input data was incorrect in some way.
26 **		This should only be used for user's data & not
27 **		system files.
28 **	EX_NOINPUT -- An input file (not a system file) did not
29 **		exist or was not readable.  This could also include
30 **		errors like "No message" to a mailer (if it cared
31 **		to catch it).
32 **	EX_NOUSER -- The user specified did not exist.  This might
33 **		be used for mail addresses or remote logins.
34 **	EX_NOHOST -- The host specified did not exist.  This is used
35 **		in mail addresses or network requests.
36 **	EX_UNAVAILABLE -- A service is unavailable.  This can occur
37 **		if a support program or file does not exist.  This
38 **		can also be used as a catchall message when something
39 **		you wanted to do doesn't work, but you don't know
40 **		why.
41 **	EX_SOFTWARE -- An internal software error has been detected.
42 **		This should be limited to non-operating system related
43 **		errors as possible.
44 **	EX_OSERR -- An operating system error has been detected.
45 **		This is intended to be used for such things as "cannot
46 **		fork", "cannot create pipe", or the like.  It includes
47 **		things like getuid returning a user that does not
48 **		exist in the passwd file.
49 **	EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
50 **		etc.) does not exist, cannot be opened, or has some
51 **		sort of error (e.g., syntax error).
52 **	EX_CANTCREAT -- A (user specified) output file cannot be
53 **		created.
54 **	EX_IOERR -- An error occurred while doing I/O on some file.
55 **	EX_TEMPFAIL -- temporary failure, indicating something that
56 **		is not really an error.  In sendmail, this means
57 **		that a mailer (e.g.) could not create a connection,
58 **		and the request should be reattempted later.
59 **	EX_PROTOCOL -- the remote system returned something that
60 **		was "not possible" during a protocol exchange.
61 **	EX_NOPERM -- You did not have sufficient permission to
62 **		perform the operation.  This is not intended for
63 **		file system problems, which should use NOINPUT or
64 **		CANTCREAT, but rather for higher level permissions.
65 **		For example, kre uses this to restrict who students
66 **		can send mail to.
67 **
68 **	Maintained by Eric Allman (eric@berkeley, ucbvax!eric) --
69 **		please mail changes to me.
70 **
71 **			@(#)sysexits.h	4.7		10/15/90
72 */
73 
74 # define EX_OK		0	/* successful termination */
75 
76 # define EX__BASE	64	/* base value for error messages */
77 
78 # define EX_USAGE	64	/* command line usage error */
79 # define EX_DATAERR	65	/* data format error */
80 # define EX_NOINPUT	66	/* cannot open input */
81 # define EX_NOUSER	67	/* addressee unknown */
82 # define EX_NOHOST	68	/* host name unknown */
83 # define EX_UNAVAILABLE	69	/* service unavailable */
84 # define EX_SOFTWARE	70	/* internal software error */
85 # define EX_OSERR	71	/* system error (e.g., can't fork) */
86 # define EX_OSFILE	72	/* critical OS file missing */
87 # define EX_CANTCREAT	73	/* can't create (user) output file */
88 # define EX_IOERR	74	/* input/output error */
89 # define EX_TEMPFAIL	75	/* temp failure; user is invited to retry */
90 # define EX_PROTOCOL	76	/* remote error in protocol */
91 # define EX_NOPERM	77	/* permission denied */
92 # define EX_CONFIG	78	/* configuration error */
93 
94 # define EX__MAX	78	/* maximum listed value */
95