1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
6 This file is part of systemd.
8 Copyright 2010 Lennart Poettering
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
26 typedef enum ExitStatus
{
27 /* EXIT_SUCCESS defined by libc */
28 /* EXIT_FAILURE defined by libc */
29 EXIT_INVALIDARGUMENT
= 2,
30 EXIT_NOTIMPLEMENTED
= 3,
31 EXIT_NOPERMISSION
= 4,
32 EXIT_NOTINSTALLED
= 5,
33 EXIT_NOTCONFIGURED
= 6,
36 /* The LSB suggests that error codes >= 200 are "reserved". We
37 * use them here under the assumption that they hence are
38 * unused by init scripts.
40 * http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html */
52 EXIT_CHROOT
, /* 210 */
62 EXIT_SETSID
, /* 220 */
69 EXIT_NO_NEW_PRIVILEGES
,
73 typedef enum ExitStatusLevel
{
77 EXIT_STATUS_FULL
= EXIT_STATUS_LSB
80 typedef struct ExitStatusSet
{
85 const char* exit_status_to_string(ExitStatus status
, ExitStatusLevel level
);
87 bool is_clean_exit(int code
, int status
, ExitStatusSet
*success_status
);
88 bool is_clean_exit_lsb(int code
, int status
, ExitStatusSet
*success_status
);