1*e33d3bd3Smillert /* $OpenBSD: sysexits.h,v 1.5 2003/06/02 19:34:12 millert Exp $ */ 2df930be7Sderaadt /* $NetBSD: sysexits.h,v 1.4 1994/10/26 00:56:33 cgd Exp $ */ 3df930be7Sderaadt 4df930be7Sderaadt /* 5df930be7Sderaadt * Copyright (c) 1987 Regents of the University of California. 6df930be7Sderaadt * All rights reserved. 7df930be7Sderaadt * 8df930be7Sderaadt * Redistribution and use in source and binary forms, with or without 9df930be7Sderaadt * modification, are permitted provided that the following conditions 10df930be7Sderaadt * are met: 11df930be7Sderaadt * 1. Redistributions of source code must retain the above copyright 12df930be7Sderaadt * notice, this list of conditions and the following disclaimer. 13df930be7Sderaadt * 2. Redistributions in binary form must reproduce the above copyright 14df930be7Sderaadt * notice, this list of conditions and the following disclaimer in the 15df930be7Sderaadt * documentation and/or other materials provided with the distribution. 16*e33d3bd3Smillert * 3. Neither the name of the University nor the names of its contributors 17df930be7Sderaadt * may be used to endorse or promote products derived from this software 18df930be7Sderaadt * without specific prior written permission. 19df930be7Sderaadt * 20df930be7Sderaadt * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21df930be7Sderaadt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22df930be7Sderaadt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23df930be7Sderaadt * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24df930be7Sderaadt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25df930be7Sderaadt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26df930be7Sderaadt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27df930be7Sderaadt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28df930be7Sderaadt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29df930be7Sderaadt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30df930be7Sderaadt * SUCH DAMAGE. 31df930be7Sderaadt * 32df930be7Sderaadt * @(#)sysexits.h 4.8 (Berkeley) 4/3/91 33df930be7Sderaadt */ 34df930be7Sderaadt 35df930be7Sderaadt #ifndef _SYSEXITS_H_ 36df930be7Sderaadt #define _SYSEXITS_H_ 37df930be7Sderaadt 38df930be7Sderaadt /* 39df930be7Sderaadt * SYSEXITS.H -- Exit status codes for system programs. 40df930be7Sderaadt * 41df930be7Sderaadt * This include file attempts to categorize possible error 42df930be7Sderaadt * exit statuses for system programs, notably delivermail 43df930be7Sderaadt * and the Berkeley network. 44df930be7Sderaadt * 45df930be7Sderaadt * Error numbers begin at EX__BASE to reduce the possibility of 46df930be7Sderaadt * clashing with other exit statuses that random programs may 47df930be7Sderaadt * already return. The meaning of the codes is approximately 48df930be7Sderaadt * as follows: 49df930be7Sderaadt * 50df930be7Sderaadt * EX_USAGE -- The command was used incorrectly, e.g., with 51df930be7Sderaadt * the wrong number of arguments, a bad flag, a bad 52df930be7Sderaadt * syntax in a parameter, or whatever. 53df930be7Sderaadt * EX_DATAERR -- The input data was incorrect in some way. 54df930be7Sderaadt * This should only be used for user's data & not 55df930be7Sderaadt * system files. 56df930be7Sderaadt * EX_NOINPUT -- An input file (not a system file) did not 57df930be7Sderaadt * exist or was not readable. This could also include 58df930be7Sderaadt * errors like "No message" to a mailer (if it cared 59df930be7Sderaadt * to catch it). 60df930be7Sderaadt * EX_NOUSER -- The user specified did not exist. This might 61df930be7Sderaadt * be used for mail addresses or remote logins. 62df930be7Sderaadt * EX_NOHOST -- The host specified did not exist. This is used 63df930be7Sderaadt * in mail addresses or network requests. 64df930be7Sderaadt * EX_UNAVAILABLE -- A service is unavailable. This can occur 65df930be7Sderaadt * if a support program or file does not exist. This 66df930be7Sderaadt * can also be used as a catchall message when something 67df930be7Sderaadt * you wanted to do doesn't work, but you don't know 68df930be7Sderaadt * why. 69df930be7Sderaadt * EX_SOFTWARE -- An internal software error has been detected. 70df930be7Sderaadt * This should be limited to non-operating system related 71df930be7Sderaadt * errors as possible. 72df930be7Sderaadt * EX_OSERR -- An operating system error has been detected. 73df930be7Sderaadt * This is intended to be used for such things as "cannot 74df930be7Sderaadt * fork", "cannot create pipe", or the like. It includes 75df930be7Sderaadt * things like getuid returning a user that does not 76df930be7Sderaadt * exist in the passwd file. 77e2b84c06Smillert * EX_OSFILE -- Some system file (e.g., /etc/passwd, /var/run/utmp, 78df930be7Sderaadt * etc.) does not exist, cannot be opened, or has some 79df930be7Sderaadt * sort of error (e.g., syntax error). 80df930be7Sderaadt * EX_CANTCREAT -- A (user specified) output file cannot be 81df930be7Sderaadt * created. 82df930be7Sderaadt * EX_IOERR -- An error occurred while doing I/O on some file. 83df930be7Sderaadt * EX_TEMPFAIL -- temporary failure, indicating something that 84df930be7Sderaadt * is not really an error. In sendmail, this means 85df930be7Sderaadt * that a mailer (e.g.) could not create a connection, 86df930be7Sderaadt * and the request should be reattempted later. 87df930be7Sderaadt * EX_PROTOCOL -- the remote system returned something that 88df930be7Sderaadt * was "not possible" during a protocol exchange. 89df930be7Sderaadt * EX_NOPERM -- You did not have sufficient permission to 90df930be7Sderaadt * perform the operation. This is not intended for 91e2b84c06Smillert * file system problems, which should use EX_NOINPUT or 92e2b84c06Smillert * EX_CANTCREAT, but rather for higher level permissions. 93e2b84c06Smillert * EX_CONFIG -- Something was found in an unconfigured or 94e2b84c06Smillert * misconfigured state. 95df930be7Sderaadt */ 96df930be7Sderaadt 97df930be7Sderaadt #define EX_OK 0 /* successful termination */ 98df930be7Sderaadt 99df930be7Sderaadt #define EX__BASE 64 /* base value for error messages */ 100df930be7Sderaadt 101df930be7Sderaadt #define EX_USAGE 64 /* command line usage error */ 102df930be7Sderaadt #define EX_DATAERR 65 /* data format error */ 103df930be7Sderaadt #define EX_NOINPUT 66 /* cannot open input */ 104df930be7Sderaadt #define EX_NOUSER 67 /* addressee unknown */ 105df930be7Sderaadt #define EX_NOHOST 68 /* host name unknown */ 106df930be7Sderaadt #define EX_UNAVAILABLE 69 /* service unavailable */ 107df930be7Sderaadt #define EX_SOFTWARE 70 /* internal software error */ 108df930be7Sderaadt #define EX_OSERR 71 /* system error (e.g., can't fork) */ 109df930be7Sderaadt #define EX_OSFILE 72 /* critical OS file missing */ 110df930be7Sderaadt #define EX_CANTCREAT 73 /* can't create (user) output file */ 111df930be7Sderaadt #define EX_IOERR 74 /* input/output error */ 112df930be7Sderaadt #define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */ 113df930be7Sderaadt #define EX_PROTOCOL 76 /* remote error in protocol */ 114df930be7Sderaadt #define EX_NOPERM 77 /* permission denied */ 115df930be7Sderaadt #define EX_CONFIG 78 /* configuration error */ 116df930be7Sderaadt 117df930be7Sderaadt #define EX__MAX 78 /* maximum listed value */ 118df930be7Sderaadt 119df930be7Sderaadt #endif /* !_SYSEXITS_H_ */ 120