Lely core libraries
2.2.5
|
Go to the documentation of this file.
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_
void daemon_set_handler(daemon_handler_t *handler, void *handle)
Sets the current daemon handler and its (optional) handle argument.
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.
int daemon_continue(void)
Sends the continue signal to the daemon handler.
@ DAEMON_USER_MAX
The largest possible value of a user-defined signal.
void daemon_handler_t(int sig, void *handle)
The function type of a handler for daemon_signal().
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_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.
@ DAEMON_PAUSE
The signal/status indicating the daemon SHOULD pause/has paused.
@ DAEMON_RELOAD
The signal indicating the daemon SHOULD reload its configuration.
@ DAEMON_USER_MIN
The smallest possible value of a user-defined signal.
@ DAEMON_CONTINUE
The signal/status indicating the daemon SHOULD continue/has continued normal operation.
int daemon_signal(int sig)
Sends a signal to a daemon, triggering the execution of the daemon handler.
@ DAEMON_START
The status indicating the daemon has started.
int daemon_stop(void)
Sends the stop signal to the daemon handler.
@ DAEMON_STOP
The signal/status indicating the daemon MUST terminate/has terminated.