]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/constants.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
4 #if !defined(HAS_FEATURE_MEMORY_SANITIZER)
5 # if defined(__has_feature)
6 # if __has_feature(memory_sanitizer)
7 # define HAS_FEATURE_MEMORY_SANITIZER 1
10 # if !defined(HAS_FEATURE_MEMORY_SANITIZER)
11 # define HAS_FEATURE_MEMORY_SANITIZER 0
15 #if !defined(HAS_FEATURE_ADDRESS_SANITIZER)
16 # ifdef __SANITIZE_ADDRESS__
17 # define HAS_FEATURE_ADDRESS_SANITIZER 1
18 # elif defined(__has_feature)
19 # if __has_feature(address_sanitizer)
20 # define HAS_FEATURE_ADDRESS_SANITIZER 1
23 # if !defined(HAS_FEATURE_ADDRESS_SANITIZER)
24 # define HAS_FEATURE_ADDRESS_SANITIZER 0
28 #define DEFAULT_TIMEOUT_USEC (90*USEC_PER_SEC)
29 #define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC)
30 #define DEFAULT_CONFIRM_USEC (30*USEC_PER_SEC)
32 /* We use an extra-long timeout for the reload. This is because a reload or reexec means generators are rerun
33 * which are timed out after DEFAULT_TIMEOUT_USEC. Let's use twice that time here, so that the generators can
34 * have their timeout, and for everything else there's the same time budget in place. */
35 #define DAEMON_RELOAD_TIMEOUT_SEC (DEFAULT_TIMEOUT_USEC * 2)
37 #define DEFAULT_START_LIMIT_INTERVAL (10*USEC_PER_SEC)
38 #define DEFAULT_START_LIMIT_BURST 5
40 /* The default time after which exit-on-idle services exit. This
41 * should be kept lower than the watchdog timeout, because otherwise
42 * the watchdog pings will keep the loop busy. */
43 #define DEFAULT_EXIT_USEC (30*USEC_PER_SEC)
45 /* The default value for the net.unix.max_dgram_qlen sysctl */
46 #define DEFAULT_UNIX_MAX_DGRAM_QLEN 512UL
48 #define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT
49 #define SIGNALS_IGNORE SIGPIPE
51 #define NOTIFY_FD_MAX 768
52 #define NOTIFY_BUFFER_MAX PIPE_BUF
55 # define _CONF_PATHS_SPLIT_USR_NULSTR(n) "/lib/" n "\0"
56 # define _CONF_PATHS_SPLIT_USR(n) , "/lib/" n
58 # define _CONF_PATHS_SPLIT_USR_NULSTR(n)
59 # define _CONF_PATHS_SPLIT_USR(n)
62 /* Return a nulstr for a standard cascade of configuration paths,
63 * suitable to pass to conf_files_list_nulstr() or config_parse_many_nulstr()
64 * to implement drop-in directories for extending configuration
66 #define CONF_PATHS_NULSTR(n) \
69 "/usr/local/lib/" n "\0" \
71 _CONF_PATHS_SPLIT_USR_NULSTR(n)
73 #define CONF_PATHS_USR(n) \
76 "/usr/local/lib/" n, \
79 #define CONF_PATHS(n) \
81 _CONF_PATHS_SPLIT_USR(n)
83 #define CONF_PATHS_USR_STRV(n) \
84 STRV_MAKE(CONF_PATHS_USR(n))
86 #define CONF_PATHS_STRV(n) \
87 STRV_MAKE(CONF_PATHS(n))
89 /* The limit for PID 1 itself (which is not inherited to children) */
90 #define HIGH_RLIMIT_MEMLOCK (1024ULL*1024ULL*64ULL)
92 /* Since kernel 5.16 the kernel default limit was raised to 8M. Let's adjust things on old kernels too, and
93 * in containers so that our children inherit that. */
94 #define DEFAULT_RLIMIT_MEMLOCK (1024ULL*1024ULL*8ULL)
96 #define PLYMOUTH_SOCKET { \
97 .un.sun_family = AF_UNIX, \
98 .un.sun_path = "\0/org/freedesktop/plymouthd", \
101 /* Path where PID1 listens for varlink subscriptions from systemd-oomd to notify of changes in ManagedOOM settings. */
102 #define VARLINK_ADDR_PATH_MANAGED_OOM_SYSTEM "/run/systemd/io.system.ManagedOOM"
103 /* Path where systemd-oomd listens for varlink connections from user managers to report changes in ManagedOOM settings. */
104 #define VARLINK_ADDR_PATH_MANAGED_OOM_USER "/run/systemd/oom/io.system.ManagedOOM"
106 #define KERNEL_BASELINE_VERSION "4.15"