chiark / gitweb /
Prep v236 : Add missing SPDX-License-Identifier (2/9) src/basic
[elogind.git] / src / basic / def.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5   This file is part of systemd.
6
7   Copyright 2010 Lennart Poettering
8
9   systemd is free software; you can redistribute it and/or modify it
10   under the terms of the GNU Lesser General Public License as published by
11   the Free Software Foundation; either version 2.1 of the License, or
12   (at your option) any later version.
13
14   systemd is distributed in the hope that it will be useful, but
15   WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17   Lesser General Public License for more details.
18
19   You should have received a copy of the GNU Lesser General Public License
20   along with systemd; If not, see <http://www.gnu.org/licenses/>.
21 ***/
22
23 #include "util.h"
24
25 #define DEFAULT_TIMEOUT_USEC (90*USEC_PER_SEC)
26 #define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC)
27 #define DEFAULT_CONFIRM_USEC (30*USEC_PER_SEC)
28
29 #define DEFAULT_START_LIMIT_INTERVAL (10*USEC_PER_SEC)
30 #define DEFAULT_START_LIMIT_BURST 5
31
32 /* The default time after which exit-on-idle services exit. This
33  * should be kept lower than the watchdog timeout, because otherwise
34  * the watchdog pings will keep the loop busy. */
35 #define DEFAULT_EXIT_USEC (30*USEC_PER_SEC)
36
37 /* The default value for the net.unix.max_dgram_qlen sysctl */
38 #define DEFAULT_UNIX_MAX_DGRAM_QLEN 512UL
39
40 #if 0 /// elogind allows foreign cgroup controllers. (Well, needs them, actually)
41 #else
42 #ifndef SYSTEMD_CGROUP_CONTROLLER_LEGACY
43 #  define SYSTEMD_CGROUP_CONTROLLER_LEGACY "name=elogind"
44 #endif // SYSTEMD_CGROUP_CONTROLLER_LEGACY
45 #ifndef SYSTEMD_CGROUP_CONTROLLER_HYBRID
46 #  define SYSTEMD_CGROUP_CONTROLLER_HYBRID "name=elogind"
47 #endif // SYSTEMD_CGROUP_CONTROLLER_HYBRID
48 #ifndef SYSTEMD_CGROUP_CONTROLLER
49 #  define SYSTEMD_CGROUP_CONTROLLER "_elogind"
50 #endif // SYSTEMD_CGROUP_CONTROLLER
51 #endif // 0
52 #define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT
53 #define SIGNALS_IGNORE SIGPIPE
54
55 #if HAVE_SPLIT_USR
56 #define KBD_KEYMAP_DIRS                         \
57         "/usr/share/keymaps/\0"                 \
58         "/usr/share/kbd/keymaps/\0"             \
59         "/usr/lib/kbd/keymaps/\0"               \
60         "/lib/kbd/keymaps/\0"
61 #else
62 #define KBD_KEYMAP_DIRS                         \
63         "/usr/share/keymaps/\0"                 \
64         "/usr/share/kbd/keymaps/\0"             \
65         "/usr/lib/kbd/keymaps/\0"
66 #endif
67
68 #define UNIX_SYSTEM_BUS_ADDRESS "unix:path=/var/run/dbus/system_bus_socket"
69 #define DEFAULT_SYSTEM_BUS_ADDRESS UNIX_SYSTEM_BUS_ADDRESS
70 #define UNIX_USER_BUS_ADDRESS_FMT "unix:path=%s/bus"
71
72 #define PLYMOUTH_SOCKET {                                       \
73                 .un.sun_family = AF_UNIX,                       \
74                 .un.sun_path = "\0/org/freedesktop/plymouthd",  \
75         }
76
77 #define NOTIFY_FD_MAX 768
78 #define NOTIFY_BUFFER_MAX PIPE_BUF
79
80 #if HAVE_SPLIT_USR
81 #  define _CONF_PATHS_SPLIT_USR(n) "/lib/" n "\0"
82 #else
83 #  define _CONF_PATHS_SPLIT_USR(n)
84 #endif
85
86 /* Return a nulstr for a standard cascade of configuration paths,
87  * suitable to pass to conf_files_list_nulstr() or config_parse_many_nulstr()
88  * to implement drop-in directories for extending configuration
89  * files. */
90 #define CONF_PATHS_NULSTR(n)                    \
91         "/etc/" n "\0"                          \
92         "/run/" n "\0"                          \
93         "/usr/local/lib/" n "\0"                \
94         "/usr/lib/" n "\0"                      \
95         _CONF_PATHS_SPLIT_USR(n)
96
97 #define LONG_LINE_MAX (1U*1024U*1024U)