#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)
# 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;
/* 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);