18ea42167SFrançois Revol/*
28ea42167SFrançois Revol * Copyright (c) 1987, 1993
38ea42167SFrançois Revol *	The Regents of the University of California.  All rights reserved.
48ea42167SFrançois Revol *
58ea42167SFrançois Revol * Redistribution and use in source and binary forms, with or without
68ea42167SFrançois Revol * modification, are permitted provided that the following conditions
78ea42167SFrançois Revol * are met:
88ea42167SFrançois Revol * 1. Redistributions of source code must retain the above copyright
98ea42167SFrançois Revol *    notice, this list of conditions and the following disclaimer.
108ea42167SFrançois Revol * 2. Redistributions in binary form must reproduce the above copyright
118ea42167SFrançois Revol *    notice, this list of conditions and the following disclaimer in the
128ea42167SFrançois Revol *    documentation and/or other materials provided with the distribution.
138ea42167SFrançois Revol * 3. Neither the name of the University nor the names of its contributors
148ea42167SFrançois Revol *    may be used to endorse or promote products derived from this software
158ea42167SFrançois Revol *    without specific prior written permission.
168ea42167SFrançois Revol *
178ea42167SFrançois Revol * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
188ea42167SFrançois Revol * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
198ea42167SFrançois Revol * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
208ea42167SFrançois Revol * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
218ea42167SFrançois Revol * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
228ea42167SFrançois Revol * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
238ea42167SFrançois Revol * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
248ea42167SFrançois Revol * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
258ea42167SFrançois Revol * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
268ea42167SFrançois Revol * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
278ea42167SFrançois Revol * SUCH DAMAGE.
288ea42167SFrançois Revol *
298ea42167SFrançois Revol *	@(#)sysexits.h	8.1 (Berkeley) 6/2/93
308ea42167SFrançois Revol *
318ea42167SFrançois Revol * $FreeBSD$
328ea42167SFrançois Revol */
338ea42167SFrançois Revol
348ea42167SFrançois Revol#ifndef	_SYSEXITS_H_
358ea42167SFrançois Revol#define	_SYSEXITS_H_
368ea42167SFrançois Revol
37091a80aeSAdrien Destugues
388ea42167SFrançois Revol/*
398ea42167SFrançois Revol *  SYSEXITS.H -- Exit status codes for system programs.
408ea42167SFrançois Revol *
418ea42167SFrançois Revol *	This include file attempts to categorize possible error
428ea42167SFrançois Revol *	exit statuses for system programs, notably delivermail
438ea42167SFrançois Revol *	and the Berkeley network.
448ea42167SFrançois Revol *
458ea42167SFrançois Revol *	Error numbers begin at EX__BASE to reduce the possibility of
468ea42167SFrançois Revol *	clashing with other exit statuses that random programs may
478ea42167SFrançois Revol *	already return.  The meaning of the codes is approximately
488ea42167SFrançois Revol *	as follows:
498ea42167SFrançois Revol *
508ea42167SFrançois Revol *	EX_USAGE -- The command was used incorrectly, e.g., with
518ea42167SFrançois Revol *		the wrong number of arguments, a bad flag, a bad
528ea42167SFrançois Revol *		syntax in a parameter, or whatever.
538ea42167SFrançois Revol *	EX_DATAERR -- The input data was incorrect in some way.
548ea42167SFrançois Revol *		This should only be used for user's data & not
558ea42167SFrançois Revol *		system files.
568ea42167SFrançois Revol *	EX_NOINPUT -- An input file (not a system file) did not
578ea42167SFrançois Revol *		exist or was not readable.  This could also include
588ea42167SFrançois Revol *		errors like "No message" to a mailer (if it cared
598ea42167SFrançois Revol *		to catch it).
608ea42167SFrançois Revol *	EX_NOUSER -- The user specified did not exist.  This might
618ea42167SFrançois Revol *		be used for mail addresses or remote logins.
628ea42167SFrançois Revol *	EX_NOHOST -- The host specified did not exist.  This is used
638ea42167SFrançois Revol *		in mail addresses or network requests.
648ea42167SFrançois Revol *	EX_UNAVAILABLE -- A service is unavailable.  This can occur
658ea42167SFrançois Revol *		if a support program or file does not exist.  This
668ea42167SFrançois Revol *		can also be used as a catchall message when something
678ea42167SFrançois Revol *		you wanted to do doesn't work, but you don't know
688ea42167SFrançois Revol *		why.
698ea42167SFrançois Revol *	EX_SOFTWARE -- An internal software error has been detected.
708ea42167SFrançois Revol *		This should be limited to non-operating system related
718ea42167SFrançois Revol *		errors as possible.
728ea42167SFrançois Revol *	EX_OSERR -- An operating system error has been detected.
738ea42167SFrançois Revol *		This is intended to be used for such things as "cannot
748ea42167SFrançois Revol *		fork", "cannot create pipe", or the like.  It includes
758ea42167SFrançois Revol *		things like getuid returning a user that does not
768ea42167SFrançois Revol *		exist in the passwd file.
778ea42167SFrançois Revol *	EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
788ea42167SFrançois Revol *		etc.) does not exist, cannot be opened, or has some
798ea42167SFrançois Revol *		sort of error (e.g., syntax error).
808ea42167SFrançois Revol *	EX_CANTCREAT -- A (user specified) output file cannot be
818ea42167SFrançois Revol *		created.
828ea42167SFrançois Revol *	EX_IOERR -- An error occurred while doing I/O on some file.
838ea42167SFrançois Revol *	EX_TEMPFAIL -- temporary failure, indicating something that
848ea42167SFrançois Revol *		is not really an error.  In sendmail, this means
858ea42167SFrançois Revol *		that a mailer (e.g.) could not create a connection,
868ea42167SFrançois Revol *		and the request should be reattempted later.
878ea42167SFrançois Revol *	EX_PROTOCOL -- the remote system returned something that
888ea42167SFrançois Revol *		was "not possible" during a protocol exchange.
898ea42167SFrançois Revol *	EX_NOPERM -- You did not have sufficient permission to
908ea42167SFrançois Revol *		perform the operation.  This is not intended for
918ea42167SFrançois Revol *		file system problems, which should use NOINPUT or
928ea42167SFrançois Revol *		CANTCREAT, but rather for higher level permissions.
938ea42167SFrançois Revol */
948ea42167SFrançois Revol
958ea42167SFrançois Revol#define EX_OK		0	/* successful termination */
968ea42167SFrançois Revol
978ea42167SFrançois Revol#define EX__BASE	64	/* base value for error messages */
988ea42167SFrançois Revol
998ea42167SFrançois Revol#define EX_USAGE	64	/* command line usage error */
1008ea42167SFrançois Revol#define EX_DATAERR	65	/* data format error */
1018ea42167SFrançois Revol#define EX_NOINPUT	66	/* cannot open input */
1028ea42167SFrançois Revol#define EX_NOUSER	67	/* addressee unknown */
1038ea42167SFrançois Revol#define EX_NOHOST	68	/* host name unknown */
1048ea42167SFrançois Revol#define EX_UNAVAILABLE	69	/* service unavailable */
1058ea42167SFrançois Revol#define EX_SOFTWARE	70	/* internal software error */
1068ea42167SFrançois Revol#define EX_OSERR	71	/* system error (e.g., can't fork) */
1078ea42167SFrançois Revol#define EX_OSFILE	72	/* critical OS file missing */
1088ea42167SFrançois Revol#define EX_CANTCREAT	73	/* can't create (user) output file */
1098ea42167SFrançois Revol#define EX_IOERR	74	/* input/output error */
1108ea42167SFrançois Revol#define EX_TEMPFAIL	75	/* temp failure; user is invited to retry */
1118ea42167SFrançois Revol#define EX_PROTOCOL	76	/* remote error in protocol */
1128ea42167SFrançois Revol#define EX_NOPERM	77	/* permission denied */
1138ea42167SFrançois Revol#define EX_CONFIG	78	/* configuration error */
1148ea42167SFrançois Revol
1158ea42167SFrançois Revol#define EX__MAX	78	/* maximum listed value */
1168ea42167SFrançois Revol
117091a80aeSAdrien Destugues
1188ea42167SFrançois Revol#endif /* !_SYSEXITS_H_ */
119