sysexits.h revision 1539
11539Srgrimes/*
21539Srgrimes * Copyright (c) 1987, 1993
31539Srgrimes *	The Regents of the University of California.  All rights reserved.
41539Srgrimes *
51539Srgrimes * Redistribution and use in source and binary forms, with or without
61539Srgrimes * modification, are permitted provided that the following conditions
71539Srgrimes * are met:
81539Srgrimes * 1. Redistributions of source code must retain the above copyright
91539Srgrimes *    notice, this list of conditions and the following disclaimer.
101539Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111539Srgrimes *    notice, this list of conditions and the following disclaimer in the
121539Srgrimes *    documentation and/or other materials provided with the distribution.
131539Srgrimes * 3. All advertising materials mentioning features or use of this software
141539Srgrimes *    must display the following acknowledgement:
151539Srgrimes *	This product includes software developed by the University of
161539Srgrimes *	California, Berkeley and its contributors.
171539Srgrimes * 4. Neither the name of the University nor the names of its contributors
181539Srgrimes *    may be used to endorse or promote products derived from this software
191539Srgrimes *    without specific prior written permission.
201539Srgrimes *
211539Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
221539Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
231539Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241539Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
251539Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261539Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271539Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281539Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291539Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301539Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311539Srgrimes * SUCH DAMAGE.
321539Srgrimes *
331539Srgrimes *	@(#)sysexits.h	8.1 (Berkeley) 6/2/93
341539Srgrimes */
351539Srgrimes
361539Srgrimes#ifndef	_SYSEXITS_H_
371539Srgrimes#define	_SYSEXITS_H_
381539Srgrimes
391539Srgrimes/*
401539Srgrimes *  SYSEXITS.H -- Exit status codes for system programs.
411539Srgrimes *
421539Srgrimes *	This include file attempts to categorize possible error
431539Srgrimes *	exit statuses for system programs, notably delivermail
441539Srgrimes *	and the Berkeley network.
451539Srgrimes *
461539Srgrimes *	Error numbers begin at EX__BASE to reduce the possibility of
471539Srgrimes *	clashing with other exit statuses that random programs may
481539Srgrimes *	already return.  The meaning of the codes is approximately
491539Srgrimes *	as follows:
501539Srgrimes *
511539Srgrimes *	EX_USAGE -- The command was used incorrectly, e.g., with
521539Srgrimes *		the wrong number of arguments, a bad flag, a bad
531539Srgrimes *		syntax in a parameter, or whatever.
541539Srgrimes *	EX_DATAERR -- The input data was incorrect in some way.
551539Srgrimes *		This should only be used for user's data & not
561539Srgrimes *		system files.
571539Srgrimes *	EX_NOINPUT -- An input file (not a system file) did not
581539Srgrimes *		exist or was not readable.  This could also include
591539Srgrimes *		errors like "No message" to a mailer (if it cared
601539Srgrimes *		to catch it).
611539Srgrimes *	EX_NOUSER -- The user specified did not exist.  This might
621539Srgrimes *		be used for mail addresses or remote logins.
631539Srgrimes *	EX_NOHOST -- The host specified did not exist.  This is used
641539Srgrimes *		in mail addresses or network requests.
651539Srgrimes *	EX_UNAVAILABLE -- A service is unavailable.  This can occur
661539Srgrimes *		if a support program or file does not exist.  This
671539Srgrimes *		can also be used as a catchall message when something
681539Srgrimes *		you wanted to do doesn't work, but you don't know
691539Srgrimes *		why.
701539Srgrimes *	EX_SOFTWARE -- An internal software error has been detected.
711539Srgrimes *		This should be limited to non-operating system related
721539Srgrimes *		errors as possible.
731539Srgrimes *	EX_OSERR -- An operating system error has been detected.
741539Srgrimes *		This is intended to be used for such things as "cannot
751539Srgrimes *		fork", "cannot create pipe", or the like.  It includes
761539Srgrimes *		things like getuid returning a user that does not
771539Srgrimes *		exist in the passwd file.
781539Srgrimes *	EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
791539Srgrimes *		etc.) does not exist, cannot be opened, or has some
801539Srgrimes *		sort of error (e.g., syntax error).
811539Srgrimes *	EX_CANTCREAT -- A (user specified) output file cannot be
821539Srgrimes *		created.
831539Srgrimes *	EX_IOERR -- An error occurred while doing I/O on some file.
841539Srgrimes *	EX_TEMPFAIL -- temporary failure, indicating something that
851539Srgrimes *		is not really an error.  In sendmail, this means
861539Srgrimes *		that a mailer (e.g.) could not create a connection,
871539Srgrimes *		and the request should be reattempted later.
881539Srgrimes *	EX_PROTOCOL -- the remote system returned something that
891539Srgrimes *		was "not possible" during a protocol exchange.
901539Srgrimes *	EX_NOPERM -- You did not have sufficient permission to
911539Srgrimes *		perform the operation.  This is not intended for
921539Srgrimes *		file system problems, which should use NOINPUT or
931539Srgrimes *		CANTCREAT, but rather for higher level permissions.
941539Srgrimes */
951539Srgrimes
961539Srgrimes#define EX_OK		0	/* successful termination */
971539Srgrimes
981539Srgrimes#define EX__BASE	64	/* base value for error messages */
991539Srgrimes
1001539Srgrimes#define EX_USAGE	64	/* command line usage error */
1011539Srgrimes#define EX_DATAERR	65	/* data format error */
1021539Srgrimes#define EX_NOINPUT	66	/* cannot open input */
1031539Srgrimes#define EX_NOUSER	67	/* addressee unknown */
1041539Srgrimes#define EX_NOHOST	68	/* host name unknown */
1051539Srgrimes#define EX_UNAVAILABLE	69	/* service unavailable */
1061539Srgrimes#define EX_SOFTWARE	70	/* internal software error */
1071539Srgrimes#define EX_OSERR	71	/* system error (e.g., can't fork) */
1081539Srgrimes#define EX_OSFILE	72	/* critical OS file missing */
1091539Srgrimes#define EX_CANTCREAT	73	/* can't create (user) output file */
1101539Srgrimes#define EX_IOERR	74	/* input/output error */
1111539Srgrimes#define EX_TEMPFAIL	75	/* temp failure; user is invited to retry */
1121539Srgrimes#define EX_PROTOCOL	76	/* remote error in protocol */
1131539Srgrimes#define EX_NOPERM	77	/* permission denied */
1141539Srgrimes#define EX_CONFIG	78	/* configuration error */
1151539Srgrimes
1161539Srgrimes#define EX__MAX	78	/* maximum listed value */
1171539Srgrimes
1181539Srgrimes#endif /* !_SYSEXITS_H_ */
119