aboutsummaryrefslogtreecommitdiffstats
path: root/src/daemon.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-29 00:02:52 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-29 00:03:49 +0100
commitd198ab627709910afdc4d9500468fab698ad6d60 (patch)
treefbb95119ec2ab2b48f35f55dace1e65cea728464 /src/daemon.h
parentthe spool does not persist between boots (diff)
downloadsat-d198ab627709910afdc4d9500468fab698ad6d60.tar.gz
sat-d198ab627709910afdc4d9500468fab698ad6d60.tar.bz2
sat-d198ab627709910afdc4d9500468fab698ad6d60.tar.xz
reopen state file, we will use flock on it, so all processes need their own open file descriptor for it
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to 'src/daemon.h')
-rw-r--r--src/daemon.h11
1 files changed, 11 insertions, 0 deletions
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);
+