]> git.ipfire.org Git - thirdparty/systemd.git/commit
pidref: add PIDREF_MAKE_FROM_PID()
authorLennart Poettering <lennart@poettering.net>
Tue, 19 Sep 2023 14:05:42 +0000 (16:05 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 28 Sep 2023 21:22:58 +0000 (23:22 +0200)
commitdcfcea6d0248d91d1eb5fab4b6a5b53608cf810c
tree5cad99790de77d237da56c8a6bd924060a76c451
parent12c7d27b654859818db407aa8ad35c0d00a0057c
pidref: add PIDREF_MAKE_FROM_PID()

This helper truns a pid_t into a PidRef. It's different from
pidref_set_pid() in being "passive", i.e. it does not attempt to acquire
a pidfd for the pid.

This is useful when using the PidRef as a lookup key that shall also
work after a process is already dead, and hence no conversion to a pidfd
is possible anymore.
src/basic/pidref.c
src/basic/pidref.h