X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=ucw%2Fdaemon.h;h=c5beacc060ca8186171e91fad6a9ef3b3878dffa;hb=b4aae2e94174b491161bd461b049c6d1b3b3602f;hp=9cdfe05027fb65bcd414afc00a30db81ef90fed1;hpb=4b752adba47e9c0bf0fc39d997e455049b62007a;p=libucw.git diff --git a/ucw/daemon.h b/ucw/daemon.h index 9cdfe050..c5beacc0 100644 --- a/ucw/daemon.h +++ b/ucw/daemon.h @@ -30,6 +30,7 @@ struct daemon_params { /** Flags passed to the daemon helper. **/ enum daemon_flags { DAEMON_FLAG_PRESERVE_CWD = 1, // Skip chdir("/") + DAEMON_FLAG_SIMULATE = 2, // Simulate daemonization (avoid fork etc.) }; /** @@ -44,6 +45,9 @@ void daemon_init(struct daemon_params *dp); * a new process and does all necessary setup. Inside the new process, it calls * @body (and when it returns, it exits the process). In the original process, it writes * the PID file and returns. + * + * When `DAEMON_FLAG_SIMULATE` is set, it justs calls @body. This is useful + * for running of daemons in a debugger. **/ void daemon_run(struct daemon_params *dp, void (*body)(struct daemon_params *dp));