From: Adhemerval Zanella Date: Fri, 3 Jul 2026 14:46:31 +0000 (-0300) Subject: Update PIDFD_* constants for Linux 7.1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b9476fa9aaed9c66b162ee3731983148b48c19da;p=thirdparty%2Fglibc.git Update PIDFD_* constants for Linux 7.1 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 --- diff --git a/sysdeps/unix/sysv/linux/sys/pidfd.h b/sysdeps/unix/sysv/linux/sys/pidfd.h index 02c2b08d28..93c7defcac 100644 --- a/sysdeps/unix/sysv/linux/sys/pidfd.h +++ b/sysdeps/unix/sysv/linux/sys/pidfd.h @@ -61,6 +61,12 @@ #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) diff --git a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py index 73ea28e3b4..3c92917cb6 100644 --- a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py +++ b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py @@ -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 \n', '#include \n'