2018-03-29 12:36:45 +10:30
|
|
|
#ifndef LIGHTNING_COMMON_DAEMON_H
|
|
|
|
#define LIGHTNING_COMMON_DAEMON_H
|
|
|
|
#include "config.h"
|
2023-04-09 12:55:09 +09:30
|
|
|
#include <ccan/tal/tal.h>
|
2018-09-03 13:10:00 +09:30
|
|
|
#include <poll.h>
|
2018-03-29 12:36:45 +10:30
|
|
|
|
|
|
|
/* Common setup for all daemons */
|
|
|
|
void daemon_setup(const char *argv0,
|
|
|
|
void (*backtrace_print)(const char *fmt, ...),
|
|
|
|
void (*backtrace_exit)(void));
|
|
|
|
|
2018-09-03 13:10:00 +09:30
|
|
|
/* Exposed for lightningd's use. */
|
|
|
|
int daemon_poll(struct pollfd *fds, nfds_t nfds, int timeout);
|
|
|
|
|
2019-04-08 09:21:30 +09:30
|
|
|
/* Print a backtrace to stderr, and via backtrace_print */
|
|
|
|
void send_backtrace(const char *why);
|
|
|
|
|
2023-04-09 12:55:09 +09:30
|
|
|
/* Try to extract a name for this function/var/etc */
|
|
|
|
const char *backtrace_symname(const tal_t *ctx, const void *addr);
|
|
|
|
|
2018-03-29 12:36:45 +10:30
|
|
|
/* Shutdown for a valgrind-clean exit (frees everything) */
|
|
|
|
void daemon_shutdown(void);
|
|
|
|
|
2023-09-21 15:06:26 +09:30
|
|
|
/* If --developer is set, set up extra developer checks, kick in a
|
|
|
|
* debugger if they set --debugger, and return true. */
|
|
|
|
bool daemon_developer_mode(char *argv[]);
|
2018-12-08 11:00:56 +10:30
|
|
|
|
2018-03-29 12:36:45 +10:30
|
|
|
#endif /* LIGHTNING_COMMON_DAEMON_H */
|