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