Debian Codegraph @

upstream/debian-unstable/man3/sysexits.h.3head

raw
1 '\" t
2 .\" Copyright 1996, Joerg Wunsch
3 .\" Copyright, the authors of the Linux man-pages project
4 .\"
5 .\" SPDX-License-Identifier: BSD-2-Clause
6 .\"
7 .TH sysexits.h 3head 2025-09-21 "Linux man-pages 6.18"
8 .SH NAME
9 sysexits.h \- exit codes for programs
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc )
13 .SH SYNOPSIS
14 .nf
15 .B #include <sysexits.h>
16 .fi
17 .TS
18 lB2 lB2 l1 lX.
19 #define EX_OK 0 /* T{
20 successful termination */
21 T}
22 .P
23 #define EX__BASE 64 /* T{
24 base value for error messages */
25 T}
26 .P
27 #define EX_USAGE 64 /* T{
28 command line usage error */
29 T}
30 #define EX_DATAERR 65 /* T{
31 data format error */
32 T}
33 #define EX_NOINPUT 66 /* T{
34 cannot open input */
35 T}
36 #define EX_NOUSER 67 /* T{
37 addressee unknown */
38 T}
39 #define EX_NOHOST 68 /* T{
40 host name unknown */
41 T}
42 #define EX_UNAVAILABLE 69 /* T{
43 service unavailable */
44 T}
45 #define EX_SOFTWARE 70 /* T{
46 internal software error */
47 T}
48 #define EX_OSERR 71 /* T{
49 system error (e.g., can't fork) */
50 T}
51 #define EX_OSFILE 72 /* T{
52 critical OS file missing */
53 T}
54 #define EX_CANTCREAT 73 /* T{
55 can't create (user) output file */
56 T}
57 #define EX_IOERR 74 /* T{
58 input/output error */
59 T}
60 #define EX_TEMPFAIL 75 /* T{
61 temp failure;
62 user is invited to retry */
63 T}
64 #define EX_PROTOCOL 76 /* T{
65 remote error in protocol */
66 T}
67 #define EX_NOPERM 77 /* T{
68 permission denied */
69 T}
70 #define EX_CONFIG 78 /* T{
71 configuration error */
72 T}
73 .P
74 .T&
75 lB2 l2 l1 lX.
76 #define EX__MAX ... /* T{
77 maximum listed value */
78 T}
79 .TE
80 .SH DESCRIPTION
81 A few programs exit with the following error codes.
82 .P
83 The successful exit is always indicated by a status of
84 .BR 0 ,
85 or
86 .B EX_OK
87 (equivalent to
88 .B EXIT_SUCCESS
89 from
90 .IR <stdlib.h> ).
91 Error numbers begin at
92 .B EX__BASE
93 to reduce the possibility of clashing with other exit statuses
94 that random programs may already return.
95 The meaning of the code is approximately as follows:
96 .TP
97 .B EX_USAGE
98 The command was used incorrectly,
99 e.g.,
100 with the wrong number of arguments,
101 a bad flag,
102 bad syntax in a parameter,
103 or whatever.
104 .TP
105 .B EX_DATAERR
106 The input data was incorrect in some way.
107 This should only be used for user's data and not system files.
108 .TP
109 .B EX_NOINPUT
110 An input file (not a system file) did not exist or was not readable.
111 This could also include errors like "No message" to a mailer
112 (if it cared to catch it).
113 .TP
114 .B EX_NOUSER
115 The user specified did not exist.
116 This might be used for mail addresses or remote logins.
117 .TP
118 .B EX_NOHOST
119 The host specified did not exist.
120 This is used in mail addresses or network requests.
121 .TP
122 .B EX_UNAVAILABLE
123 A service is unavailable.
124 This can occur if a support program or file does not exist.
125 This can also be used as a catch-all message
126 when something you wanted to do doesn't work, but you don't know why.
127 .TP
128 .B EX_SOFTWARE
129 An internal software error has been detected.
130 This should be limited to non-operating system related errors if possible.
131 .TP
132 .B EX_OSERR
133 An operating system error has been detected.
134 This is intended to be used for such things as
135 "cannot fork",
136 "cannot create pipe",
137 or the like.
138 It includes things like
139 .BR getuid (2)
140 returning a user that does not exist in the
141 .BR passwd (5)
142 file.
143 .TP
144 .B EX_OSFILE
145 Some system file
146 (e.g.,
147 .IR /etc/passwd ,
148 .IR /etc/utmp ,
149 etc.)
150 does not exist,
151 cannot be opened,
152 or has some sort of error (e.g., syntax error).
153 .TP
154 .B EX_CANTCREAT
155 A (user specified) output file cannot be created.
156 .TP
157 .B EX_IOERR
158 An error occurred while doing I/O on some file.
159 .TP
160 .B EX_TEMPFAIL
161 Temporary failure,
162 indicating something that is not really an error.
163 For example that a mailer could not create a connection,
164 and the request should be reattempted later.
165 .TP
166 .B EX_PROTOCOL
167 The remote system returned something that
168 was "not possible" during a protocol exchange.
169 .TP
170 .B EX_OSFILE
171 You did not have sufficient permission to perform the operation.
172 This is not intended for file system problems,
173 which should use
174 .B EX_NOINPUT
175 or
176 .BR EX_CANTCREAT ,
177 but rather for higher level permissions.
178 .TP
179 .B EX_CONFIG
180 Something was found in an unconfigured or misconfigured state.
181 .P
182 The numerical values corresponding to the symbolical ones
183 are given in parenthesis for easy reference.
184 .SH STANDARDS
185 BSD.
186 .SH HISTORY
187 The
188 .I <sysexits.h>
189 file appeared in 4.0BSD for use by the deliverymail utility,
190 later renamed to
191 .BR sendmail (8).
192 .SH CAVEATS
193 The choice of an appropriate exit value is often ambiguous.
194 .SH SEE ALSO
195 .BR err (3),
196 .BR error (3),
197 .BR exit (3)