]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic: move missing_pidfd.h -> include/sys/pidfd.h
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 18 Jun 2025 00:32:01 +0000 (09:32 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 1 Jul 2025 03:27:39 +0000 (12:27 +0900)
src/basic/include/sys/pidfd.h [moved from src/basic/missing_pidfd.h with 92% similarity]
src/basic/pidfd-util.h

similarity index 92%
rename from src/basic/missing_pidfd.h
rename to src/basic/include/sys/pidfd.h
index 968875e8959676ce41d8cae4dee45c61d03cb3bb..de13144524bae1417f82eaf5345a7c0b32a07999 100644 (file)
@@ -2,15 +2,17 @@
 #pragma once
 
 #include <linux/types.h>
+#include <sys/ioctl.h>
+
+/* since glibc-2.36 */
 #if HAVE_PIDFD_OPEN
-#include <sys/pidfd.h> /* IWYU pragma: export */
+#include_next <sys/pidfd.h>
 #endif
 
+/* since glibc-2.41 */
 #ifndef PIDFS_IOCTL_MAGIC
 #  define PIDFS_IOCTL_MAGIC 0xFF
-#endif
 
-#ifndef PIDFD_GET_CGROUP_NAMESPACE
 #  define PIDFD_GET_CGROUP_NAMESPACE              _IO(PIDFS_IOCTL_MAGIC, 1)
 #  define PIDFD_GET_IPC_NAMESPACE                 _IO(PIDFS_IOCTL_MAGIC, 2)
 #  define PIDFD_GET_MNT_NAMESPACE                 _IO(PIDFS_IOCTL_MAGIC, 3)
@@ -23,6 +25,7 @@
 #  define PIDFD_GET_UTS_NAMESPACE                 _IO(PIDFS_IOCTL_MAGIC, 10)
 #endif
 
+/* defined in linux/pidfd.h */
 #ifndef PIDFD_GET_INFO
 struct pidfd_info {
         __u64 mask;
index e998b8a3bcfb1a1edb2208d962467fb16164a56a..0cc247ced16372eafe9532e63eac4a7e06f62907 100644 (file)
@@ -1,8 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <sys/pidfd.h>          /* IWYU pragma: export */
+
 #include "forward.h"
-#include "missing_pidfd.h"      /* IWYU pragma: export */
 #include "missing_syscall.h"    /* IWYU pragma: export */
 
 int pidfd_get_namespace(int fd, unsigned long ns_type_cmd);