diff options
author | Luca Boccassi <luca.boccassi@gmail.com> | 2024-10-10 16:52:32 +0100 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-10-24 13:54:51 +0200 |
commit | cdda1f26e74bac732eca537a69f19f6a37b641be (patch) | |
tree | 07fcfc8122c1a1ef147f40f70d58fa68232f5200 /drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | |
parent | 8e929cb546ee42c9a61d24fae60605e9e3192354 (diff) | |
download | linux-cdda1f26e74bac732eca537a69f19f6a37b641be.tar.gz linux-cdda1f26e74bac732eca537a69f19f6a37b641be.tar.bz2 linux-cdda1f26e74bac732eca537a69f19f6a37b641be.zip |
pidfd: add ioctl to retrieve pid info
A common pattern when using pid fds is having to get information
about the process, which currently requires /proc being mounted,
resolving the fd to a pid, and then do manual string parsing of
/proc/N/status and friends. This needs to be reimplemented over
and over in all userspace projects (e.g.: I have reimplemented
resolving in systemd, dbus, dbus-daemon, polkit so far), and
requires additional care in checking that the fd is still valid
after having parsed the data, to avoid races.
Having a programmatic API that can be used directly removes all
these requirements, including having /proc mounted.
As discussed at LPC24, add an ioctl with an extensible struct
so that more parameters can be added later if needed. Start with
returning pid/tgid/ppid and creds unconditionally, and cgroupid
optionally.
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Link: https://lore.kernel.org/r/20241010155401.2268522-1-luca.boccassi@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c')
0 files changed, 0 insertions, 0 deletions