mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
pidref: add trivial helper pidref_set_self() to set pidref to our handle to our own process
This commit is contained in:
@@ -39,6 +39,10 @@ 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 */
|
||||
|
||||
static inline int pidref_set_self(PidRef *pidref) {
|
||||
return pidref_set_pid(pidref, 0);
|
||||
}
|
||||
|
||||
void pidref_done(PidRef *pidref);
|
||||
PidRef *pidref_free(PidRef *pidref);
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(PidRef*, pidref_free);
|
||||
|
||||
Reference in New Issue
Block a user