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