Some tools like systemd's jounral need to retrieve the exit and cgroup information after a process has already been reaped. This can e.g., happen when retrieving a pidfd via SCM_PIDFD or SCM_PEERPIDFD.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -20,6 +20,7 @@ · 19 unmodified lines | ||
| 20 | 20 | #define PIDFD_INFO_PID (1UL << 0) /* Always returned, even if not requested */ |
| 21 | 21 | #define PIDFD_INFO_CREDS (1UL << 1) /* Always returned, even if not requested */ |
| 22 | 22 | #define PIDFD_INFO_CGROUPID (1UL << 2) /* Always returned if available, even if not requested */ |
| 23 | +#define PIDFD_INFO_EXIT (1UL << 3) /* Only returned if requested. */ | |
| 23 | 24 | |
| 24 | 25 | #define PIDFD_INFO_SIZE_VER0 64 /* sizeof first published struct */ |
| 25 | 26 | |
| @@ -86,7 +87,7 @@ struct pidfd_info { · 60 unmodified lines | ||
| 86 | 87 | __u32 sgid; |
| 87 | 88 | __u32 fsuid; |
| 88 | 89 | __u32 fsgid; |
| 89 | − __u32 spare0[1]; | |
| 90 | + __s32 exit_code; | |
| 90 | 91 | }; |
| 91 | 92 | |
| 92 | 93 | #define PIDFS_IOCTL_MAGIC 0xFF |