From 995f5b53eaea97f08f7de433f4e51bb0d5610019 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 25 Dec 2015 16:54:39 +0100 Subject: add undaemonise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- include/unistd.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'include') diff --git a/include/unistd.h b/include/unistd.h index 4629e8e..963bb96 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -1138,6 +1138,8 @@ int daemon(int, int) * should be used instead of /run for the runtime data-files * directory, in which the PID file is stored. * + * This is a slibc extension. + * * @etymology (Daemonise) the process! * * @param name The name of the daemon. Use a hardcoded value, @@ -1174,6 +1176,23 @@ int daemon(int, int) */ int daemonise(const char*, int) __GCC_ONLY(__attribute__((__nonnull__, __warn_unused_result__))); + +/** + * Remove the PID file created by `daemonise`. This shall + * always be called before exiting after calling `daemonise`, + * even if it failed. + * + * This is a slibc extension. + * + * @etymology (Un)link PID file created by `(daemonise)`! + * + * @return Zero on success, -1 on error. + * + * @throws Any error specified for unlink(3). + * + * @since Always. + */ +int undaemonise(void); #endif -- cgit v1.2.3-70-g09d2