xref: /netbsd-src/include/sysexits.h (revision 35d2bef12aa128a805116ae128d95e3c2d6a3596)
1*35d2bef1Srpaulo /*	$NetBSD: sysexits.h,v 1.7 2005/09/30 20:56:19 rpaulo Exp $	*/
24d2cbfceScgd 
361f28255Scgd /*
4b7b7322cSperry  * Copyright (c) 1987, 1993
5b7b7322cSperry  *	The Regents of the University of California.  All rights reserved.
661f28255Scgd  *
761f28255Scgd  * Redistribution and use in source and binary forms, with or without
861f28255Scgd  * modification, are permitted provided that the following conditions
961f28255Scgd  * are met:
1061f28255Scgd  * 1. Redistributions of source code must retain the above copyright
1161f28255Scgd  *    notice, this list of conditions and the following disclaimer.
1261f28255Scgd  * 2. Redistributions in binary form must reproduce the above copyright
1361f28255Scgd  *    notice, this list of conditions and the following disclaimer in the
1461f28255Scgd  *    documentation and/or other materials provided with the distribution.
15039cc956Sagc  * 3. Neither the name of the University nor the names of its contributors
1661f28255Scgd  *    may be used to endorse or promote products derived from this software
1761f28255Scgd  *    without specific prior written permission.
1861f28255Scgd  *
1961f28255Scgd  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2061f28255Scgd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2161f28255Scgd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2261f28255Scgd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2361f28255Scgd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2461f28255Scgd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2561f28255Scgd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2661f28255Scgd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2761f28255Scgd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2861f28255Scgd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2961f28255Scgd  * SUCH DAMAGE.
3061f28255Scgd  *
31b7b7322cSperry  *	@(#)sysexits.h	8.1 (Berkeley) 6/2/93
3261f28255Scgd  */
3361f28255Scgd 
3461f28255Scgd #ifndef	_SYSEXITS_H_
35b8385343Smycroft #define	_SYSEXITS_H_
3661f28255Scgd 
3761f28255Scgd /*
3861f28255Scgd  *  SYSEXITS.H -- Exit status codes for system programs.
3961f28255Scgd  *
4061f28255Scgd  *	This include file attempts to categorize possible error
4161f28255Scgd  *	exit statuses for system programs, notably delivermail
4261f28255Scgd  *	and the Berkeley network.
4361f28255Scgd  *
4461f28255Scgd  *	Error numbers begin at EX__BASE to reduce the possibility of
4561f28255Scgd  *	clashing with other exit statuses that random programs may
4661f28255Scgd  *	already return.  The meaning of the codes is approximately
4761f28255Scgd  *	as follows:
4861f28255Scgd  *
4961f28255Scgd  *	EX_USAGE -- The command was used incorrectly, e.g., with
5061f28255Scgd  *		the wrong number of arguments, a bad flag, a bad
5161f28255Scgd  *		syntax in a parameter, or whatever.
5261f28255Scgd  *	EX_DATAERR -- The input data was incorrect in some way.
5361f28255Scgd  *		This should only be used for user's data & not
5461f28255Scgd  *		system files.
5561f28255Scgd  *	EX_NOINPUT -- An input file (not a system file) did not
5661f28255Scgd  *		exist or was not readable.  This could also include
5761f28255Scgd  *		errors like "No message" to a mailer (if it cared
5861f28255Scgd  *		to catch it).
5961f28255Scgd  *	EX_NOUSER -- The user specified did not exist.  This might
6061f28255Scgd  *		be used for mail addresses or remote logins.
6161f28255Scgd  *	EX_NOHOST -- The host specified did not exist.  This is used
6261f28255Scgd  *		in mail addresses or network requests.
6361f28255Scgd  *	EX_UNAVAILABLE -- A service is unavailable.  This can occur
6461f28255Scgd  *		if a support program or file does not exist.  This
6561f28255Scgd  *		can also be used as a catchall message when something
6661f28255Scgd  *		you wanted to do doesn't work, but you don't know
6761f28255Scgd  *		why.
6861f28255Scgd  *	EX_SOFTWARE -- An internal software error has been detected.
6961f28255Scgd  *		This should be limited to non-operating system related
7061f28255Scgd  *		errors as possible.
7161f28255Scgd  *	EX_OSERR -- An operating system error has been detected.
7261f28255Scgd  *		This is intended to be used for such things as "cannot
7361f28255Scgd  *		fork", "cannot create pipe", or the like.  It includes
7461f28255Scgd  *		things like getuid returning a user that does not
7561f28255Scgd  *		exist in the passwd file.
7661f28255Scgd  *	EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
7761f28255Scgd  *		etc.) does not exist, cannot be opened, or has some
7861f28255Scgd  *		sort of error (e.g., syntax error).
7961f28255Scgd  *	EX_CANTCREAT -- A (user specified) output file cannot be
8061f28255Scgd  *		created.
8161f28255Scgd  *	EX_IOERR -- An error occurred while doing I/O on some file.
8261f28255Scgd  *	EX_TEMPFAIL -- temporary failure, indicating something that
8361f28255Scgd  *		is not really an error.  In sendmail, this means
8461f28255Scgd  *		that a mailer (e.g.) could not create a connection,
8561f28255Scgd  *		and the request should be reattempted later.
8661f28255Scgd  *	EX_PROTOCOL -- the remote system returned something that
8761f28255Scgd  *		was "not possible" during a protocol exchange.
8861f28255Scgd  *	EX_NOPERM -- You did not have sufficient permission to
8961f28255Scgd  *		perform the operation.  This is not intended for
9061f28255Scgd  *		file system problems, which should use NOINPUT or
9161f28255Scgd  *		CANTCREAT, but rather for higher level permissions.
92*35d2bef1Srpaulo  *
93*35d2bef1Srpaulo  *	Please update the sysexits(3) man page after adding more entries.
9461f28255Scgd  */
9561f28255Scgd 
9661f28255Scgd #define EX_OK		0	/* successful termination */
9761f28255Scgd 
9861f28255Scgd #define EX__BASE	64	/* base value for error messages */
9961f28255Scgd 
10061f28255Scgd #define EX_USAGE	64	/* command line usage error */
10161f28255Scgd #define EX_DATAERR	65	/* data format error */
10261f28255Scgd #define EX_NOINPUT	66	/* cannot open input */
10361f28255Scgd #define EX_NOUSER	67	/* addressee unknown */
10461f28255Scgd #define EX_NOHOST	68	/* host name unknown */
10561f28255Scgd #define EX_UNAVAILABLE	69	/* service unavailable */
10661f28255Scgd #define EX_SOFTWARE	70	/* internal software error */
10761f28255Scgd #define EX_OSERR	71	/* system error (e.g., can't fork) */
10861f28255Scgd #define EX_OSFILE	72	/* critical OS file missing */
10961f28255Scgd #define EX_CANTCREAT	73	/* can't create (user) output file */
11061f28255Scgd #define EX_IOERR	74	/* input/output error */
11161f28255Scgd #define EX_TEMPFAIL	75	/* temp failure; user is invited to retry */
11261f28255Scgd #define EX_PROTOCOL	76	/* remote error in protocol */
11361f28255Scgd #define EX_NOPERM	77	/* permission denied */
11461f28255Scgd #define EX_CONFIG	78	/* configuration error */
11561f28255Scgd 
11661f28255Scgd #define EX__MAX	78	/* maximum listed value */
11761f28255Scgd 
118b8385343Smycroft #endif /* !_SYSEXITS_H_ */
119