]> git.saurik.com Git - apple/libc.git/blame - include/sysexits.h
Libc-391.4.1.tar.gz
[apple/libc.git] / include / sysexits.h
CommitLineData
5b2abdfb
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
734aad71
A
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
5b2abdfb
A
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
734aad71
A
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
5b2abdfb
A
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/*
24 * Copyright (c) 1987, 1993
25 * The Regents of the University of California. All rights reserved.
26 *
27 * Redistribution and use in source and binary forms, with or without
28 * modification, are permitted provided that the following conditions
29 * are met:
30 * 1. Redistributions of source code must retain the above copyright
31 * notice, this list of conditions and the following disclaimer.
32 * 2. Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the distribution.
35 * 3. All advertising materials mentioning features or use of this software
36 * must display the following acknowledgement:
37 * This product includes software developed by the University of
38 * California, Berkeley and its contributors.
39 * 4. Neither the name of the University nor the names of its contributors
40 * may be used to endorse or promote products derived from this software
41 * without specific prior written permission.
42 *
43 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
44 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
45 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
46 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
47 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
48 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
49 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
51 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
52 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
53 * SUCH DAMAGE.
54 *
55 * @(#)sysexits.h 8.1 (Berkeley) 6/2/93
56 */
57
58#ifndef _SYSEXITS_H_
59#define _SYSEXITS_H_
60
61/*
62 * SYSEXITS.H -- Exit status codes for system programs.
63 *
64 * This include file attempts to categorize possible error
65 * exit statuses for system programs, notably delivermail
66 * and the Berkeley network.
67 *
68 * Error numbers begin at EX__BASE to reduce the possibility of
69 * clashing with other exit statuses that random programs may
70 * already return. The meaning of the codes is approximately
71 * as follows:
72 *
73 * EX_USAGE -- The command was used incorrectly, e.g., with
74 * the wrong number of arguments, a bad flag, a bad
75 * syntax in a parameter, or whatever.
76 * EX_DATAERR -- The input data was incorrect in some way.
77 * This should only be used for user's data & not
78 * system files.
79 * EX_NOINPUT -- An input file (not a system file) did not
80 * exist or was not readable. This could also include
81 * errors like "No message" to a mailer (if it cared
82 * to catch it).
83 * EX_NOUSER -- The user specified did not exist. This might
84 * be used for mail addresses or remote logins.
85 * EX_NOHOST -- The host specified did not exist. This is used
86 * in mail addresses or network requests.
87 * EX_UNAVAILABLE -- A service is unavailable. This can occur
88 * if a support program or file does not exist. This
89 * can also be used as a catchall message when something
90 * you wanted to do doesn't work, but you don't know
91 * why.
92 * EX_SOFTWARE -- An internal software error has been detected.
93 * This should be limited to non-operating system related
94 * errors as possible.
95 * EX_OSERR -- An operating system error has been detected.
96 * This is intended to be used for such things as "cannot
97 * fork", "cannot create pipe", or the like. It includes
98 * things like getuid returning a user that does not
99 * exist in the passwd file.
100 * EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
101 * etc.) does not exist, cannot be opened, or has some
102 * sort of error (e.g., syntax error).
103 * EX_CANTCREAT -- A (user specified) output file cannot be
104 * created.
105 * EX_IOERR -- An error occurred while doing I/O on some file.
106 * EX_TEMPFAIL -- temporary failure, indicating something that
107 * is not really an error. In sendmail, this means
108 * that a mailer (e.g.) could not create a connection,
109 * and the request should be reattempted later.
110 * EX_PROTOCOL -- the remote system returned something that
111 * was "not possible" during a protocol exchange.
112 * EX_NOPERM -- You did not have sufficient permission to
113 * perform the operation. This is not intended for
114 * file system problems, which should use NOINPUT or
115 * CANTCREAT, but rather for higher level permissions.
116 */
117
118#define EX_OK 0 /* successful termination */
119
120#define EX__BASE 64 /* base value for error messages */
121
122#define EX_USAGE 64 /* command line usage error */
123#define EX_DATAERR 65 /* data format error */
124#define EX_NOINPUT 66 /* cannot open input */
125#define EX_NOUSER 67 /* addressee unknown */
126#define EX_NOHOST 68 /* host name unknown */
127#define EX_UNAVAILABLE 69 /* service unavailable */
128#define EX_SOFTWARE 70 /* internal software error */
129#define EX_OSERR 71 /* system error (e.g., can't fork) */
130#define EX_OSFILE 72 /* critical OS file missing */
131#define EX_CANTCREAT 73 /* can't create (user) output file */
132#define EX_IOERR 74 /* input/output error */
133#define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */
134#define EX_PROTOCOL 76 /* remote error in protocol */
135#define EX_NOPERM 77 /* permission denied */
136#define EX_CONFIG 78 /* configuration error */
137
138#define EX__MAX 78 /* maximum listed value */
139
140#endif /* !_SYSEXITS_H_ */