pidref: add new pidref_is_self() helper

This simply checks if the specified PidRef refers to the process we are
running in.

(In case you wonder why this is not a static inline: to avoid cyclic
header inclusion problems between pidref.h + process-util.h)
This commit is contained in:
Lennart Poettering
2023-10-18 14:39:33 +02:00
parent d7d748548b
commit a7a877697f
5 changed files with 13 additions and 4 deletions
+2
View File
@@ -43,6 +43,8 @@ static inline int pidref_set_self(PidRef *pidref) {
return pidref_set_pid(pidref, 0);
}
bool pidref_is_self(const PidRef *pidref);
void pidref_done(PidRef *pidref);
PidRef *pidref_free(PidRef *pidref);
DEFINE_TRIVIAL_CLEANUP_FUNC(PidRef*, pidref_free);