1#ifndef _SYS_EXITS_H_INCLUDED_
2#define _SYS_EXITS_H_INCLUDED_
3
4/*++
5/* NAME
6/*	sys_exits 3h
7/* SUMMARY
8/*	sendmail-compatible exit status handling
9/* SYNOPSIS
10/*	#include <sys_exits.h>
11/* DESCRIPTION
12/* .nf
13
14 /*
15  * External interface.
16  */
17typedef struct {
18    const int status;			/* exit status code */
19    const char *dsn;			/* DSN detail */
20    const char *text;			/* descriptive text */
21} SYS_EXITS_DETAIL;
22
23extern const char *sys_exits_strerror(int);
24extern const SYS_EXITS_DETAIL *sys_exits_detail(int);
25extern int sys_exits_softerror(int);
26
27#define SYS_EXITS_CODE(n) ((n) >= EX__BASE && (n) <= EX__MAX)
28
29#define EX__BASE	64		/* base value for error messages */
30
31#define EX_USAGE	64		/* command line usage error */
32#define EX_DATAERR	65		/* data format error */
33#define EX_NOINPUT	66		/* cannot open input */
34#define EX_NOUSER	67		/* addressee unknown */
35#define EX_NOHOST	68		/* host name unknown */
36#define EX_UNAVAILABLE	69		/* service unavailable */
37#define EX_SOFTWARE	70		/* internal software error */
38#define EX_OSERR	71		/* system error (e.g., can't fork) */
39#define EX_OSFILE	72		/* critical OS file missing */
40#define EX_CANTCREAT	73		/* can't create (user) output file */
41#define EX_IOERR	74		/* input/output error */
42#define EX_TEMPFAIL	75		/* temporary failure */
43#define EX_PROTOCOL	76		/* remote error in protocol */
44#define EX_NOPERM	77		/* permission denied */
45#define EX_CONFIG	78		/* configuration error */
46
47#define EX__MAX	78			/* maximum listed value */
48
49/* LICENSE
50/* .ad
51/* .fi
52/*	The Secure Mailer license must be distributed with this software.
53/* AUTHOR(S)
54/*	Wietse Venema
55/*	IBM T.J. Watson Research
56/*	P.O. Box 704
57/*	Yorktown Heights, NY 10598, USA
58/*--*/
59
60#endif
61