xref: /illumos-gate/usr/src/head/sysexits.h (revision 8124b8119d8ab7f80f1bd8b094cd96356f531b54)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1989 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved	*/
29 
30 /*
31  * Portions of this source code were derived from Berkeley 4.3 BSD
32  * under license from the Regents of the University of California.
33  */
34 
35 #ifndef _SYSEXITS_H
36 #define	_SYSEXITS_H
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /*
43  *  SYSEXITS.H -- Exit status codes employed by the mail subsystem.
44  *
45  *	This include file attempts to categorize possible error
46  *	exit statuses for mail subsystem.
47  *
48  *	Error numbers begin at EX__BASE to reduce the possibility of
49  *	clashing with other exit statuses that random programs may
50  *	already return.  The meaning of the codes is approximately
51  *	as follows:
52  *
53  *	EX_USAGE -- The command was used incorrectly, e.g., with
54  *		the wrong number of arguments, a bad flag, a bad
55  *		syntax in a parameter, or whatever.
56  *	EX_DATAERR -- The input data was incorrect in some way.
57  *		This should only be used for user's data & not
58  *		system files.
59  *	EX_NOINPUT -- An input file (not a system file) did not
60  *		exist or was not readable.  This could also include
61  *		errors like "No message" to a mailer (if it cared
62  *		to catch it).
63  *	EX_NOUSER -- The user specified did not exist.  This might
64  *		be used for mail addresses or remote logins.
65  *	EX_NOHOST -- The host specified did not exist.  This is used
66  *		in mail addresses or network requests.
67  *	EX_UNAVAILABLE -- A service is unavailable.  This can occur
68  *		if a support program or file does not exist.  This
69  *		can also be used as a catchall message when something
70  *		you wanted to do doesn't work, but you don't know
71  *		why.
72  *	EX_SOFTWARE -- An internal software error has been detected.
73  *		This should be limited to non-operating system related
74  *		errors as possible.
75  *	EX_OSERR -- An operating system error has been detected.
76  *		This is intended to be used for such things as "cannot
77  *		fork", "cannot create pipe", or the like.  It includes
78  *		things like getuid returning a user that does not
79  *		exist in the passwd file.
80  *	EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
81  *		etc.) does not exist, cannot be opened, or has some
82  *		sort of error (e.g., syntax error).
83  *	EX_CANTCREAT -- A (user specified) output file cannot be
84  *		created.
85  *	EX_IOERR -- An error occurred while doing I/O on some file.
86  *	EX_TEMPFAIL -- temporary failure, indicating something that
87  *		is not really an error.  In sendmail, this means
88  *		that a mailer (e.g.) could not create a connection,
89  *		and the request should be reattempted later.
90  *	EX_PROTOCOL -- the remote system returned something that
91  *		was "not possible" during a protocol exchange.
92  *	EX_NOPERM -- You did not have sufficient permission to
93  *		perform the operation.  This is not intended for
94  *		file system problems, which should use NOINPUT or
95  *		CANTCREAT, but rather for higher level permissions.
96  *		For example, kre uses this to restrict who students
97  *		can send mail to.
98  */
99 
100 #define	EX_OK		0	/* successful termination */
101 
102 #define	EX__BASE	64	/* base value for error messages */
103 
104 #define	EX_USAGE	64	/* command line usage error */
105 #define	EX_DATAERR	65	/* data format error */
106 #define	EX_NOINPUT	66	/* cannot open input */
107 #define	EX_NOUSER	67	/* addressee unknown */
108 #define	EX_NOHOST	68	/* host name unknown */
109 #define	EX_UNAVAILABLE	69	/* service unavailable */
110 #define	EX_SOFTWARE	70	/* internal software error */
111 #define	EX_OSERR	71	/* system error (e.g., can't fork) */
112 #define	EX_OSFILE	72	/* critical OS file missing */
113 #define	EX_CANTCREAT	73	/* can't create (user) output file */
114 #define	EX_IOERR	74	/* input/output error */
115 #define	EX_TEMPFAIL	75	/* temp failure; user is invited to retry */
116 #define	EX_PROTOCOL	76	/* remote error in protocol */
117 #define	EX_NOPERM	77	/* permission denied */
118 #define	EX_CONFIG	78	/* configuration error */
119 
120 #define	EX_NOTFOUND	79	/* entry not found */
121 #define	EX__MAX	79	/* maximum listed value */
122 
123 
124 #ifdef __cplusplus
125 }
126 #endif
127 
128 #endif	/* _SYSEXITS_H */
129