xref: /freebsd/include/sysexits.h (revision 5ccaab1797e5bdc404f2299ebaec1265547a4744)
12321c474SPedro F. Giffuni /*-
22321c474SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
32321c474SPedro F. Giffuni  *
459deaec5SRodney W. Grimes  * Copyright (c) 1987, 1993
559deaec5SRodney W. Grimes  *	The Regents of the University of California.  All rights reserved.
659deaec5SRodney W. Grimes  *
759deaec5SRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
859deaec5SRodney W. Grimes  * modification, are permitted provided that the following conditions
959deaec5SRodney W. Grimes  * are met:
1059deaec5SRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
1159deaec5SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
1259deaec5SRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
1359deaec5SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
1459deaec5SRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
15f2556687SWarner Losh  * 3. Neither the name of the University nor the names of its contributors
1659deaec5SRodney W. Grimes  *    may be used to endorse or promote products derived from this software
1759deaec5SRodney W. Grimes  *    without specific prior written permission.
1859deaec5SRodney W. Grimes  *
1959deaec5SRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2059deaec5SRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2159deaec5SRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2259deaec5SRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2359deaec5SRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2459deaec5SRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2559deaec5SRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2659deaec5SRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2759deaec5SRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2859deaec5SRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2959deaec5SRodney W. Grimes  * SUCH DAMAGE.
3059deaec5SRodney W. Grimes  */
3159deaec5SRodney W. Grimes 
3259deaec5SRodney W. Grimes #ifndef	_SYSEXITS_H_
3359deaec5SRodney W. Grimes #define	_SYSEXITS_H_
3459deaec5SRodney W. Grimes 
3559deaec5SRodney W. Grimes /*
3659deaec5SRodney W. Grimes  *  SYSEXITS.H -- Exit status codes for system programs.
3759deaec5SRodney W. Grimes  *
38*5ccaab17SAlexander Ziaee  *	This include file attempts to categorize error exit statuses
39*5ccaab17SAlexander Ziaee  *	for system programs, notably sendmail. These values exist only
40*5ccaab17SAlexander Ziaee  *	for interface compatibility, and are deprecated for FreeBSD
41*5ccaab17SAlexander Ziaee  *	base software.
4259deaec5SRodney W. Grimes  *
4359deaec5SRodney W. Grimes  *	Error numbers begin at EX__BASE to reduce the possibility of
4459deaec5SRodney W. Grimes  *	clashing with other exit statuses that random programs may
4559deaec5SRodney W. Grimes  *	already return.  The meaning of the codes is approximately
4659deaec5SRodney W. Grimes  *	as follows:
4759deaec5SRodney W. Grimes  *
4859deaec5SRodney W. Grimes  *	EX_USAGE -- The command was used incorrectly, e.g., with
4959deaec5SRodney W. Grimes  *		the wrong number of arguments, a bad flag, a bad
5059deaec5SRodney W. Grimes  *		syntax in a parameter, or whatever.
5159deaec5SRodney W. Grimes  *	EX_DATAERR -- The input data was incorrect in some way.
5259deaec5SRodney W. Grimes  *		This should only be used for user's data & not
5359deaec5SRodney W. Grimes  *		system files.
5459deaec5SRodney W. Grimes  *	EX_NOINPUT -- An input file (not a system file) did not
5559deaec5SRodney W. Grimes  *		exist or was not readable.  This could also include
5659deaec5SRodney W. Grimes  *		errors like "No message" to a mailer (if it cared
5759deaec5SRodney W. Grimes  *		to catch it).
5859deaec5SRodney W. Grimes  *	EX_NOUSER -- The user specified did not exist.  This might
5959deaec5SRodney W. Grimes  *		be used for mail addresses or remote logins.
6059deaec5SRodney W. Grimes  *	EX_NOHOST -- The host specified did not exist.  This is used
6159deaec5SRodney W. Grimes  *		in mail addresses or network requests.
6259deaec5SRodney W. Grimes  *	EX_UNAVAILABLE -- A service is unavailable.  This can occur
6359deaec5SRodney W. Grimes  *		if a support program or file does not exist.  This
6459deaec5SRodney W. Grimes  *		can also be used as a catchall message when something
6559deaec5SRodney W. Grimes  *		you wanted to do doesn't work, but you don't know
6659deaec5SRodney W. Grimes  *		why.
6759deaec5SRodney W. Grimes  *	EX_SOFTWARE -- An internal software error has been detected.
6859deaec5SRodney W. Grimes  *		This should be limited to non-operating system related
6959deaec5SRodney W. Grimes  *		errors as possible.
7059deaec5SRodney W. Grimes  *	EX_OSERR -- An operating system error has been detected.
7159deaec5SRodney W. Grimes  *		This is intended to be used for such things as "cannot
7259deaec5SRodney W. Grimes  *		fork", "cannot create pipe", or the like.  It includes
7359deaec5SRodney W. Grimes  *		things like getuid returning a user that does not
7459deaec5SRodney W. Grimes  *		exist in the passwd file.
7559deaec5SRodney W. Grimes  *	EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
7659deaec5SRodney W. Grimes  *		etc.) does not exist, cannot be opened, or has some
7759deaec5SRodney W. Grimes  *		sort of error (e.g., syntax error).
7859deaec5SRodney W. Grimes  *	EX_CANTCREAT -- A (user specified) output file cannot be
7959deaec5SRodney W. Grimes  *		created.
8059deaec5SRodney W. Grimes  *	EX_IOERR -- An error occurred while doing I/O on some file.
8159deaec5SRodney W. Grimes  *	EX_TEMPFAIL -- temporary failure, indicating something that
8259deaec5SRodney W. Grimes  *		is not really an error.  In sendmail, this means
8359deaec5SRodney W. Grimes  *		that a mailer (e.g.) could not create a connection,
8459deaec5SRodney W. Grimes  *		and the request should be reattempted later.
8559deaec5SRodney W. Grimes  *	EX_PROTOCOL -- the remote system returned something that
8659deaec5SRodney W. Grimes  *		was "not possible" during a protocol exchange.
8759deaec5SRodney W. Grimes  *	EX_NOPERM -- You did not have sufficient permission to
8859deaec5SRodney W. Grimes  *		perform the operation.  This is not intended for
8959deaec5SRodney W. Grimes  *		file system problems, which should use NOINPUT or
9059deaec5SRodney W. Grimes  *		CANTCREAT, but rather for higher level permissions.
9159deaec5SRodney W. Grimes  */
9259deaec5SRodney W. Grimes 
9359deaec5SRodney W. Grimes #define EX_OK		0	/* successful termination */
9459deaec5SRodney W. Grimes 
9559deaec5SRodney W. Grimes #define EX__BASE	64	/* base value for error messages */
9659deaec5SRodney W. Grimes 
9759deaec5SRodney W. Grimes #define EX_USAGE	64	/* command line usage error */
9859deaec5SRodney W. Grimes #define EX_DATAERR	65	/* data format error */
9959deaec5SRodney W. Grimes #define EX_NOINPUT	66	/* cannot open input */
10059deaec5SRodney W. Grimes #define EX_NOUSER	67	/* addressee unknown */
10159deaec5SRodney W. Grimes #define EX_NOHOST	68	/* host name unknown */
10259deaec5SRodney W. Grimes #define EX_UNAVAILABLE	69	/* service unavailable */
10359deaec5SRodney W. Grimes #define EX_SOFTWARE	70	/* internal software error */
10459deaec5SRodney W. Grimes #define EX_OSERR	71	/* system error (e.g., can't fork) */
10559deaec5SRodney W. Grimes #define EX_OSFILE	72	/* critical OS file missing */
10659deaec5SRodney W. Grimes #define EX_CANTCREAT	73	/* can't create (user) output file */
10759deaec5SRodney W. Grimes #define EX_IOERR	74	/* input/output error */
10859deaec5SRodney W. Grimes #define EX_TEMPFAIL	75	/* temp failure; user is invited to retry */
10959deaec5SRodney W. Grimes #define EX_PROTOCOL	76	/* remote error in protocol */
11059deaec5SRodney W. Grimes #define EX_NOPERM	77	/* permission denied */
11159deaec5SRodney W. Grimes #define EX_CONFIG	78	/* configuration error */
11259deaec5SRodney W. Grimes 
11359deaec5SRodney W. Grimes #define EX__MAX	78	/* maximum listed value */
11459deaec5SRodney W. Grimes 
11559deaec5SRodney W. Grimes #endif /* !_SYSEXITS_H_ */
116