History

pidfs: allow to retrieve exit information

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.

Christian Brauner committed 1 year ago

Commit 7477d7d1 parent 45135222 files · +70 −19Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/pidfd.h+2−1
@@ -20,6 +20,7 @@ · 19 unmodified lines
20#define PIDFD_INFO_PID (1UL << 0) /* Always returned, even if not requested */20#define PIDFD_INFO_PID (1UL << 0) /* Always returned, even if not requested */
21#define PIDFD_INFO_CREDS (1UL << 1) /* Always returned, even if not requested */21#define PIDFD_INFO_CREDS (1UL << 1) /* Always returned, even if not requested */
22#define PIDFD_INFO_CGROUPID (1UL << 2) /* Always returned if available, even if not requested */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#define PIDFD_INFO_SIZE_VER0 64 /* sizeof first published struct */25#define PIDFD_INFO_SIZE_VER0 64 /* sizeof first published struct */
25 26
@@ -86,7 +87,7 @@ struct pidfd_info { · 60 unmodified lines
86 __u32 sgid;87 __u32 sgid;
87 __u32 fsuid;88 __u32 fsuid;
88 __u32 fsgid;89 __u32 fsgid;
89 __u32 spare0[1];90 __s32 exit_code;
90};91};
91 92
92#define PIDFS_IOCTL_MAGIC 0xFF93#define PIDFS_IOCTL_MAGIC 0xFF