xref: /illumos-gate/usr/src/head/sysexits.h (revision 711890bc9379ceea66272dc8d4981812224ea86e)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 /*
45  *  SYSEXITS.H -- Exit status codes employed by the mail subsystem.
46  *
47  *	This include file attempts to categorize possible error
48  *	exit statuses for mail subsystem.
49  *
50  *	Error numbers begin at EX__BASE to reduce the possibility of
51  *	clashing with other exit statuses that random programs may
52  *	already return.  The meaning of the codes is approximately
53  *	as follows:
54  *
55  *	EX_USAGE -- The command was used incorrectly, e.g., with
56  *		the wrong number of arguments, a bad flag, a bad
57  *		syntax in a parameter, or whatever.
58  *	EX_DATAERR -- The input data was incorrect in some way.
59  *		This should only be used for user's data & not
60  *		system files.
61  *	EX_NOINPUT -- An input file (not a system file) did not
62  *		exist or was not readable.  This could also include
63  *		errors like "No message" to a mailer (if it cared
64  *		to catch it).
65  *	EX_NOUSER -- The user specified did not exist.  This might
66  *		be used for mail addresses or remote logins.
67  *	EX_NOHOST -- The host specified did not exist.  This is used
68  *		in mail addresses or network requests.
69  *	EX_UNAVAILABLE -- A service is unavailable.  This can occur
70  *		if a support program or file does not exist.  This
71  *		can also be used as a catchall message when something
72  *		you wanted to do doesn't work, but you don't know
73  *		why.
74  *	EX_SOFTWARE -- An internal software error has been detected.
75  *		This should be limited to non-operating system related
76  *		errors as possible.
77  *	EX_OSERR -- An operating system error has been detected.
78  *		This is intended to be used for such things as "cannot
79  *		fork", "cannot create pipe", or the like.  It includes
80  *		things like getuid returning a user that does not
81  *		exist in the passwd file.
82  *	EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
83  *		etc.) does not exist, cannot be opened, or has some
84  *		sort of error (e.g., syntax error).
85  *	EX_CANTCREAT -- A (user specified) output file cannot be
86  *		created.
87  *	EX_IOERR -- An error occurred while doing I/O on some file.
88  *	EX_TEMPFAIL -- temporary failure, indicating something that
89  *		is not really an error.  In sendmail, this means
90  *		that a mailer (e.g.) could not create a connection,
91  *		and the request should be reattempted later.
92  *	EX_PROTOCOL -- the remote system returned something that
93  *		was "not possible" during a protocol exchange.
94  *	EX_NOPERM -- You did not have sufficient permission to
95  *		perform the operation.  This is not intended for
96  *		file system problems, which should use NOINPUT or
97  *		CANTCREAT, but rather for higher level permissions.
98  *		For example, kre uses this to restrict who students
99  *		can send mail to.
100  */
101 
102 #define	EX_OK		0	/* successful termination */
103 
104 #define	EX__BASE	64	/* base value for error messages */
105 
106 #define	EX_USAGE	64	/* command line usage error */
107 #define	EX_DATAERR	65	/* data format error */
108 #define	EX_NOINPUT	66	/* cannot open input */
109 #define	EX_NOUSER	67	/* addressee unknown */
110 #define	EX_NOHOST	68	/* host name unknown */
111 #define	EX_UNAVAILABLE	69	/* service unavailable */
112 #define	EX_SOFTWARE	70	/* internal software error */
113 #define	EX_OSERR	71	/* system error (e.g., can't fork) */
114 #define	EX_OSFILE	72	/* critical OS file missing */
115 #define	EX_CANTCREAT	73	/* can't create (user) output file */
116 #define	EX_IOERR	74	/* input/output error */
117 #define	EX_TEMPFAIL	75	/* temp failure; user is invited to retry */
118 #define	EX_PROTOCOL	76	/* remote error in protocol */
119 #define	EX_NOPERM	77	/* permission denied */
120 #define	EX_CONFIG	78	/* configuration error */
121 
122 #define	EX_NOTFOUND	79	/* entry not found */
123 #define	EX__MAX	79	/* maximum listed value */
124 
125 
126 #ifdef __cplusplus
127 }
128 #endif
129 
130 #endif	/* _SYSEXITS_H */
131