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