From d198ab627709910afdc4d9500468fab698ad6d60 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 29 Dec 2015 00:02:52 +0100 Subject: reopen state file, we will use flock on it, so all processes need their own open file descriptor for it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/daemon.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/daemon.h') diff --git a/src/daemon.h b/src/daemon.h index 2c0d0ff..c642f66 100644 --- a/src/daemon.h +++ b/src/daemon.h @@ -150,3 +150,14 @@ char **restore_array(char *buf, size_t len, size_t *n); */ char **sublist(char *const *list, size_t n); +/** + * Create a new open file descriptor for an already + * existing file descriptor. + * + * @param fd The file descriptor that shall be promoted + * to a new open file descriptor. + * @param oflag See open(3), `O_CREAT` is not allowed. + * @return 0 on success, -1 on error. + */ +int reopen(int fd, int oflag); + -- cgit v1.2.3-70-g09d2