1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
3 #ifndef fooexitstatushfoo
4 #define fooexitstatushfoo
7 This file is part of systemd.
9 Copyright 2010 Lennart Poettering
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.
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.
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/>.
27 typedef enum ExitStatus {
28 /* EXIT_SUCCESS defined by libc */
29 /* EXIT_FAILURE defined by libc */
30 EXIT_INVALIDARGUMENT = 2,
31 EXIT_NOTIMPLEMENTED = 3,
32 EXIT_NOPERMISSION = 4,
33 EXIT_NOTINSTALLED = 5,
34 EXIT_NOTCONFIGURED = 6,
37 /* The LSB suggests that error codes >= 200 are "reserved". We
38 * use them here under the assumption that they hence are
39 * unused by init scripts.
41 * http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html */
53 EXIT_CHROOT, /* 210 */
63 EXIT_SETSID, /* 220 */
72 typedef enum ExitStatusLevel {
76 EXIT_STATUS_FULL = EXIT_STATUS_LSB
79 const char* exit_status_to_string(ExitStatus status, ExitStatusLevel level);
81 bool is_clean_exit(int code, int status);
82 bool is_clean_exit_lsb(int code, int status);