Home | History | Annotate | Download | only in current
      1 /*	$OpenBSD: sysexits.h,v 1.5 2003/06/02 19:34:12 millert Exp $	*/
      2 /*	$NetBSD: sysexits.h,v 1.4 1994/10/26 00:56:33 cgd Exp $	*/
      3 
      4 /*
      5  * Copyright (c) 1987 Regents of the University of California.
      6  * All rights reserved.
      7  *
      8  * Redistribution and use in source and binary forms, with or without
      9  * modification, are permitted provided that the following conditions
     10  * are met:
     11  * 1. Redistributions of source code must retain the above copyright
     12  *    notice, this list of conditions and the following disclaimer.
     13  * 2. Redistributions in binary form must reproduce the above copyright
     14  *    notice, this list of conditions and the following disclaimer in the
     15  *    documentation and/or other materials provided with the distribution.
     16  * 3. Neither the name of the University nor the names of its contributors
     17  *    may be used to endorse or promote products derived from this software
     18  *    without specific prior written permission.
     19  *
     20  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     23  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     24  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     25  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     26  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     27  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     29  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     30  * SUCH DAMAGE.
     31  *
     32  *	@(#)sysexits.h	4.8 (Berkeley) 4/3/91
     33  */
     34 
     35 #pragma once
     36 
     37 /**
     38  * @file sysexits.h
     39  * @brief Exit status codes for system programs.
     40  *
     41  * This include file attempts to categorize possible error
     42  * exit statuses for system programs such as sendmail.
     43  */
     44 
     45 #include <sys/cdefs.h>
     46 
     47 /** Successful termination. */
     48 #define EX_OK  0
     49 
     50 /**
     51  * Base value for error messages.
     52  * Error numbers begin at `EX__BASE` to reduce the possibility of
     53  * clashing with other exit statuses that random programs may
     54  * already return.
     55  */
     56 #define EX__BASE 64
     57 
     58 /**
     59  * Command line usage error.
     60  * The command was used incorrectly, such as the wrong number of
     61  * arguments, a bad flag, or bad syntax for a parameter.
     62  */
     63 #define EX_USAGE 64
     64 
     65 /**
     66  * Data format error.
     67  * The input data was incorrect in some way.
     68  * This should only be used for user's data and not for system files.
     69  */
     70 #define EX_DATAERR 65
     71 
     72 /**
     73  * Cannot open input.
     74  * An input file (not a system file) did not exist or was not readable.
     75  * This could also include errors like "No message" to a mailer (if it cared
     76  * to catch it).
     77  */
     78 #define EX_NOINPUT 66
     79 
     80 /**
     81  * The specified user did not exist.
     82  * This might be used for mail addresses or remote logins.
     83  */
     84 #define EX_NOUSER 67
     85 
     86 /**
     87  * The specified host did not exist.
     88  * This is used in mail addresses or network requests.
     89  */
     90 #define EX_NOHOST 68
     91 
     92 /**
     93  * A service is unavailable.
     94  * This can occur if a support program or file does not exist.
     95  * This can also be used as a catchall message when something
     96  * you wanted to do doesn't work, but you don't know why.
     97  */
     98 #define EX_UNAVAILABLE 69
     99 
    100 /**
    101  * An internal software error has been detected.
    102  * This should be limited to non-operating system related errors.
    103  */
    104 #define EX_SOFTWARE 70
    105 
    106 /**
    107  * An operating system error has been detected.
    108  * This is intended to be used for such things as "cannot
    109  * fork", "cannot create pipe", or the like.  It includes
    110  * things like getuid returning a user that does not
    111  * exist in the passwd file.
    112  */
    113 #define EX_OSERR 71
    114 
    115 /**
    116  * Critical OS file error.
    117  * A system file (such as /etc/passwd) does not exist, cannot be opened,
    118  * or has some other problem (such as a syntax error).
    119  */
    120 #define EX_OSFILE 72
    121 
    122 /**
    123  * Can't create (user) output file.
    124  * A (user specified) output file cannot be created.
    125  */
    126 #define EX_CANTCREAT 73
    127 
    128 /**
    129  * Input/output error.
    130  * An error occurred while doing I/O on some file.
    131  */
    132 #define EX_IOERR 74
    133 
    134 /**
    135  * Temporary failure; user is invited to retry.
    136  * A temporary failure, indicating something that
    137  * is not really an error.  In sendmail, this might mean
    138  * that a mailer could not create a connection,
    139  * and the request should be reattempted later.
    140  */
    141 #define EX_TEMPFAIL 75
    142 
    143 /**
    144  * Remote error in protocol.
    145  * The remote system returned something that
    146  * was "not possible" during a protocol exchange.
    147  */
    148 #define EX_PROTOCOL 76
    149 
    150 /**
    151  * Permission denied.
    152  * You did not have sufficient permission to perform the operation.
    153  * This is not intended for file system problems, which should use EX_NOINPUT or
    154  * EX_CANTCREAT, but rather for higher level permissions.
    155  */
    156 #define EX_NOPERM 77
    157 
    158 /**
    159  * Configuration error.
    160  * Something was found in an unconfigured or misconfigured state.
    161  */
    162 #define EX_CONFIG 78
    163 
    164 /** Maximum listed value. */
    165 #define EX__MAX  78
    166