1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 This file is part of systemd.
7 Copyright 2010 Lennart Poettering
16 /* This defines pretty names for the LSB 'start' verb exit codes. Note that they shouldn't be confused with the LSB
17 * 'status' verb exit codes which are defined very differently. For details see:
19 * https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
23 /* EXIT_SUCCESS defined by libc */
24 /* EXIT_FAILURE defined by libc */
25 EXIT_INVALIDARGUMENT
= 2,
26 EXIT_NOTIMPLEMENTED
= 3,
27 EXIT_NOPERMISSION
= 4,
28 EXIT_NOTINSTALLED
= 5,
29 EXIT_NOTCONFIGURED
= 6,
32 /* The LSB suggests that error codes >= 200 are "reserved". We
33 * use them here under the assumption that they hence are
34 * unused by init scripts. */
46 EXIT_CHROOT
, /* 210 */
56 EXIT_SETSID
, /* 220 */
59 _EXIT_RESERVED
, /* used to be tcpwrap, don't reuse! */
63 EXIT_NO_NEW_PRIVILEGES
,
66 EXIT_PERSONALITY
, /* 230 */
67 EXIT_APPARMOR_PROFILE
,
68 EXIT_ADDRESS_FAMILIES
,
69 EXIT_RUNTIME_DIRECTORY
,
70 _EXIT_RESERVED2
, /* used to be used by kdbus, don't reuse */
72 EXIT_SMACK_PROCESS_LABEL
,
76 EXIT_LOGS_DIRECTORY
, /* 240 */
77 EXIT_CONFIGURATION_DIRECTORY
,
80 typedef enum ExitStatusLevel
{
81 EXIT_STATUS_MINIMAL
, /* only cover libc EXIT_STATUS/EXIT_FAILURE */
82 EXIT_STATUS_SYSTEMD
, /* cover libc and systemd's own exit codes */
83 EXIT_STATUS_LSB
, /* cover libc, systemd's own and LSB exit codes */
84 EXIT_STATUS_FULL
= EXIT_STATUS_LSB
87 typedef struct ExitStatusSet
{
92 const char* exit_status_to_string(int status
, ExitStatusLevel level
) _const_
;
94 typedef enum ExitClean
{
99 bool is_clean_exit(int code
, int status
, ExitClean clean
, ExitStatusSet
*success_status
);
101 void exit_status_set_free(ExitStatusSet
*x
);
102 bool exit_status_set_is_empty(ExitStatusSet
*x
);
103 bool exit_status_set_test(ExitStatusSet
*x
, int code
, int status
);