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