chiark / gitweb /
service: reword warnings a little
[elogind.git] / src / exit-status.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3 #ifndef fooexitstatushfoo
4 #define fooexitstatushfoo
5
6 /***
7   This file is part of systemd.
8
9   Copyright 2010 Lennart Poettering
10
11   systemd is free software; you can redistribute it and/or modify it
12   under the terms of the GNU General Public License as published by
13   the Free Software Foundation; either version 2 of the License, or
14   (at your option) any later version.
15
16   systemd is distributed in the hope that it will be useful, but
17   WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   General Public License for more details.
20
21   You should have received a copy of the GNU General Public License
22   along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 ***/
24
25 typedef enum ExitStatus {
26         /* EXIT_SUCCESS defined by libc */
27         /* EXIT_FAILURE defined by libc */
28         EXIT_INVALIDARGUMENT = 2,
29         EXIT_NOTIMPLEMENTED = 3,
30         EXIT_NOPERMISSION = 4,
31         EXIT_NOTINSTALLED = 5,
32         EXIT_NOTCONFIGURED = 6,
33         EXIT_NOTRUNNING = 7,
34
35         /* The LSB suggests that error codes >= 200 are "reserved". We
36          * use them here under the assumption that they hence are
37          * unused by init scripts.
38          *
39          * http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html */
40
41         EXIT_CHDIR = 200,
42         EXIT_NICE,
43         EXIT_FDS,
44         EXIT_EXEC,
45         EXIT_MEMORY,
46         EXIT_LIMITS,
47         EXIT_OOM_ADJUST,
48         EXIT_SIGNAL_MASK,
49         EXIT_STDIN,
50         EXIT_STDOUT,
51         EXIT_CHROOT,   /* 210 */
52         EXIT_IOPRIO,
53         EXIT_TIMERSLACK,
54         EXIT_SECUREBITS,
55         EXIT_SETSCHEDULER,
56         EXIT_CPUAFFINITY,
57         EXIT_GROUP,
58         EXIT_USER,
59         EXIT_CAPABILITIES,
60         EXIT_CGROUP,
61         EXIT_SETSID,   /* 220 */
62         EXIT_CONFIRM,
63         EXIT_STDERR,
64         EXIT_TCPWRAP,
65         EXIT_PAM
66
67 } ExitStatus;
68
69 typedef enum ExitStatusLevel {
70         EXIT_STATUS_MINIMAL,
71         EXIT_STATUS_SYSTEMD,
72         EXIT_STATUS_LSB,
73         EXIT_STATUS_FULL = EXIT_STATUS_LSB
74 } ExitStatusLevel;
75
76 const char* exit_status_to_string(ExitStatus status, ExitStatusLevel level);
77
78 #endif