]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pid: add pidfd_prepare()
authorChristian Brauner <brauner@kernel.org>
Mon, 27 Mar 2023 18:22:51 +0000 (20:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:40:25 +0000 (14:40 +0200)
commit1ced79b25fa29a1b38ef12d5acd85b54e1c8593c
tree219052bb5123f69d51e3c5ec2ac86d278a2c66e8
parentfc7846a7d5320d37cbc027f13043e0b58b345766
pid: add pidfd_prepare()

commit 6ae930d9dbf2d093157be33428538c91966d8a9f upstream.

Add a new helper that allows to reserve a pidfd and allocates a new
pidfd file that stashes the provided struct pid. This will allow us to
remove places that either open code this function or that call
pidfd_create() but then have to call close_fd() because there are still
failure points after pidfd_create() has been called.

Reviewed-by: Jan Kara <jack@suse.cz>
Message-Id: <20230327-pidfd-file-api-v1-1-5c0e9a3158e4@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/pid.h
kernel/fork.c
kernel/pid.c