pidref: add pidref_set_parent() for race-freely getting pidref on ppid

This commit is contained in:
Lennart Poettering
2023-12-13 18:00:14 +01:00
parent f9ba9d3eb7
commit a1796e9bd8
2 changed files with 33 additions and 1 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ int pidref_set_pidstr(PidRef *pidref, const char *pid);
int pidref_set_pidfd(PidRef *pidref, int fd);
int pidref_set_pidfd_take(PidRef *pidref, int fd); /* takes ownership of the passed pidfd on success*/
int pidref_set_pidfd_consume(PidRef *pidref, int fd); /* takes ownership of the passed pidfd in both success and failure */
int pidref_set_parent(PidRef *ret);
static inline int pidref_set_self(PidRef *pidref) {
return pidref_set_pid(pidref, 0);
}