]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update PIDFD_* constants for Linux 7.1
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 3 Jul 2026 14:46:31 +0000 (11:46 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 3 Jul 2026 19:31:48 +0000 (16:31 -0300)
The pidfd_info interface was extended to report coredump information:

  * PIDFD_INFO_SUPPORTED_MASK, along with the supported_mask field, so
    userspace can check which flags the running kernel supports (commit
    dfd78546c95330db2252e0d7e937a15ab5eddb4e, Linux 6.19).

  * PIDFD_INFO_COREDUMP_SIGNAL, along with the coredump_signal field
    (commit 036375522be8425874e9e0f907c7127e315c7a52, Linux 6.19).

  * PIDFD_INFO_COREDUMP_CODE, along with the coredump_code field (commit
    701f7f4fbabbf4989ba6fbf033b160dd943221d5, Linux 7.1).

The struct pidfd_info is extended accordingly and PIDFD_INFO_SIZE_VER1,
PIDFD_INFO_SIZE_VER2, and PIDFD_INFO_SIZE_VER3 are added to reflect the
new struct sizes.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
sysdeps/unix/sysv/linux/sys/pidfd.h
sysdeps/unix/sysv/linux/tst-pidfd-consts.py

index 02c2b08d28e7e504f1abb450fa82f27b574ca888..93c7defcac3fb938c31b2eadcf26c9c2a288de8d 100644 (file)
 #define PIDFD_INFO_EXIT                       (1UL << 3)
 /* Only returned if requested. */
 #define PIDFD_INFO_COREDUMP                   (1UL << 4)
+/* Want/got supported mask flags */
+#define PIDFD_INFO_SUPPORTED_MASK             (1UL << 5)
+/* Always returned if PIDFD_INFO_COREDUMP is requested. */
+#define PIDFD_INFO_COREDUMP_SIGNAL            (1UL << 6)
+/* Always returned if PIDFD_INFO_COREDUMP is requested. */
+#define PIDFD_INFO_COREDUMP_CODE              (1UL << 7)
 
 
 /* Value for coredump_mask in pidfd_info.  Only valid if PIDFD_INFO_COREDUMP
@@ -92,11 +98,20 @@ struct pidfd_info
   __uint32_t fsgid;
   __int32_t  exit_code;
   __uint32_t coredump_mask;
-  __uint32_t __spare1;
+  __uint32_t coredump_signal;
+  __uint32_t coredump_code;
+  __uint32_t coredump_pad;
+  __uint64_t supported_mask;
 };
 
 /* sizeof first published struct */
 #define PIDFD_INFO_SIZE_VER0                  64
+/* sizeof second published struct */
+#define PIDFD_INFO_SIZE_VER1                  72
+/* sizeof third published struct */
+#define PIDFD_INFO_SIZE_VER2                  80
+/* sizeof fourth published struct */
+#define PIDFD_INFO_SIZE_VER3                  88
 
 #define PIDFD_GET_INFO                        _IOWR(PIDFS_IOCTL_MAGIC, 11, struct pidfd_info)
 
index 73ea28e3b4a95c25f14bf845bf1b5485794fd7c6..3c92917cb63e779865f9dbb9d5aa8160802d1c81 100644 (file)
@@ -39,7 +39,7 @@ def main():
         sys.exit (77)
 
     linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
-    linux_version_glibc = (6, 17)
+    linux_version_glibc = (7, 1)
     sys.exit(glibcextract.compare_macro_consts(
                 '#include <sys/pidfd.h>\n',
                 '#include <asm/fcntl.h>\n'