diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2015-12-31 01:20:14 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2015-12-31 01:20:14 +0100 |
commit | 12ce1683a5901ffa00b96f5805855e568a3c6054 (patch) | |
tree | 98550f60bd200eb74ac4a499387ed4c06c957835 /include | |
parent | m bug fix (diff) | |
download | slibc-12ce1683a5901ffa00b96f5805855e568a3c6054.tar.gz slibc-12ce1683a5901ffa00b96f5805855e568a3c6054.tar.bz2 slibc-12ce1683a5901ffa00b96f5805855e568a3c6054.tar.xz |
daemonise: add option to override pid file
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/unistd.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/unistd.h b/include/unistd.h index d95e08a..8479ae9 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -1082,6 +1082,14 @@ int daemon(int, int) #define DAEMONISE_KEEP_FDS 1024 /** + * Override the PID file if it already exists, + * rather than failing. It is a bad idea to do + * this unless you already made sure that the + * daemon is not already running. + */ +#define DAEMONISE_NEW_PID 2048 + +/** * Daemonise the process. This means to: * * - close all file descritors except for those to @@ -1163,6 +1171,7 @@ int daemon(int, int) * - `DAEMONISE_KEEP_STDIN` * - `DAEMONISE_KEEP_STDOUT` * - `DAEMONISE_KEEP_FDS` + * - `DAEMONISE_NEW_PID` * @param ... Enabled if `DAEMONISE_KEEP_FDS` is used, * do not add anything if `DAEMONISE_KEEP_FDS` * is unused. This is a `-1`-terminated list |