22 #ifndef LELY_UTIL_DAEMON_H_ 23 #define LELY_UTIL_DAEMON_H_ 97 int daemon_start(
const char *name,
int (*init)(
int,
char **),
98 void (*main)(
void),
void (*fini)(
void),
int argc,
char *argv[]);
184 #endif // !LELY_UTIL_DAEMON_H_ The signal indicating the daemon SHOULD reload its configuration.
int daemon_status(int status)
Sets the current daemon status (one of DAEMON_START, DAEMON_STOP, DAEMON_PAUSE or DAEMON_CONTINUE)...
int daemon_start(const char *name, int(*init)(int, char **), void(*main)(void), void(*fini)(void), int argc, char *argv[])
Executes the supplied function as a POSIX daemon or Windows service.
The smallest possible value of a user-defined signal.
The status indicating the daemon has started.
The signal/status indicating the daemon SHOULD pause/has paused.
int daemon_pause(void)
Sends the pause signal to the daemon handler.
void daemon_get_handler(daemon_handler_t **phandler, void **phandle)
Retrieves current daemon handler and handle argument.
The signal/status indicating the daemon SHOULD continue/has continued normal operation.
The signal/status indicating the daemon MUST terminate/has terminated.
int daemon_signal(int sig)
Sends a signal to a daemon, triggering the execution of the daemon handler.
int daemon_stop(void)
Sends the stop signal to the daemon handler.
void daemon_handler_t(int sig, void *handle)
The function type of a handler for daemon_signal().
The largest possible value of a user-defined signal.
This is the public header file of the utilities library.
void daemon_set_handler(daemon_handler_t *handler, void *handle)
Sets the current daemon handler and its (optional) handle argument.
int daemon_reload(void)
Sends the reload signal to the daemon handler.
void default_daemon_handler(int sig, void *handle)
The default daemon_signal() handler.
int daemon_continue(void)
Sends the continue signal to the daemon handler.