diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-01-06 00:26:25 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-01-06 03:16:39 +0100 |
commit | a354329f724d6ce913d2ccffb2be8f3327a67faa (patch) | |
tree | b6b05cc2c42c274f8385a16b1896d6c88bf4fc8f /src/shared/util.h | |
parent | 75399049653f2d5e22032da70cf96f20d7b4d9a6 (diff) |
core: add new logic for services to store file descriptors in PID 1
With this change it is possible to send file descriptors to PID 1, via
sd_pid_notify_with_fds() which PID 1 will store individually for each
service, and pass via the usual fd passing logic on next invocation.
This is useful for enable daemon reload schemes where daemons serialize
their state to /run, push their fds into PID 1 and terminate, restoring
their state on next start from the data in /run and passed in from PID
1.
The fds are kept by PID 1 as long as no POLLHUP or POLLERR is seen on
them, and the service they belong to are either not dead or failed, or
have a job queued.
Diffstat (limited to 'src/shared/util.h')
-rw-r--r-- | src/shared/util.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shared/util.h b/src/shared/util.h index a131a3c0f1..4b7e12e628 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -1069,3 +1069,5 @@ int fd_setcrtime(int fd, usec_t usec); int fd_getcrtime(int fd, usec_t *usec); int path_getcrtime(const char *p, usec_t *usec); int fd_getcrtime_at(int dirfd, const char *name, usec_t *usec, int flags); + +int same_fd(int a, int b); |