summaryrefslogtreecommitdiffstats
path: root/src/basic/missing_namespace.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-11-22 17:11:29 +0100
committerLennart Poettering <lennart@poettering.net>2024-11-23 00:14:20 +0100
commit18ead2b03d9df251ab682539648a556ace239dc7 (patch)
tree7f5ee59a070263a2537f79ee1ab406be12ce29fb /src/basic/missing_namespace.h
parentlink README.logs from tmpfiles.d/legacy.conf only if available (diff)
downloadsystemd-18ead2b03d9df251ab682539648a556ace239dc7.tar.xz
systemd-18ead2b03d9df251ab682539648a556ace239dc7.zip
namespace-util: add generic namespace_is_init() call
Diffstat (limited to 'src/basic/missing_namespace.h')
-rw-r--r--src/basic/missing_namespace.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/basic/missing_namespace.h b/src/basic/missing_namespace.h
new file mode 100644
index 0000000000..318c0143b8
--- /dev/null
+++ b/src/basic/missing_namespace.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+/* Root namespace inode numbers, as per include/linux/proc_ns.h in the kernel source tree, since v3.8:
+ * https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=98f842e675f96ffac96e6c50315790912b2812be */
+
+#define PROC_IPC_INIT_INO ((ino_t) UINT32_C(0xEFFFFFFF))
+#define PROC_UTS_INIT_INO ((ino_t) UINT32_C(0xEFFFFFFE))
+#define PROC_USER_INIT_INO ((ino_t) UINT32_C(0xEFFFFFFD))
+#define PROC_PID_INIT_INO ((ino_t) UINT32_C(0xEFFFFFFC))
+#define PROC_CGROUP_INIT_INO ((ino_t) UINT32_C(0xEFFFFFFB))
+#define PROC_TIME_INIT_INO ((ino_t) UINT32_C(0xEFFFFFFA))