2018-03-29 04:06:45 +02:00
|
|
|
#ifndef LIGHTNING_COMMON_DAEMON_H
|
|
|
|
#define LIGHTNING_COMMON_DAEMON_H
|
|
|
|
#include "config.h"
|
2018-09-03 05:40:00 +02:00
|
|
|
#include <poll.h>
|
2018-03-29 04:06:45 +02:00
|
|
|
|
|
|
|
/* Common setup for all daemons */
|
|
|
|
void daemon_setup(const char *argv0,
|
|
|
|
void (*backtrace_print)(const char *fmt, ...),
|
|
|
|
void (*backtrace_exit)(void));
|
|
|
|
|
2018-09-03 05:40:00 +02:00
|
|
|
/* Exposed for lightningd's use. */
|
|
|
|
int daemon_poll(struct pollfd *fds, nfds_t nfds, int timeout);
|
|
|
|
|
2019-04-08 01:51:30 +02:00
|
|
|
/* Print a backtrace to stderr, and via backtrace_print */
|
|
|
|
void send_backtrace(const char *why);
|
|
|
|
|
2018-03-29 04:06:45 +02:00
|
|
|
/* Shutdown for a valgrind-clean exit (frees everything) */
|
|
|
|
void daemon_shutdown(void);
|
|
|
|
|
2018-12-08 01:30:56 +01:00
|
|
|
/* Kick in a debugger if they set --debugger */
|
2019-01-15 05:13:27 +01:00
|
|
|
void daemon_maybe_debug(char *argv[]);
|
2018-12-08 01:30:56 +01:00
|
|
|
|
2018-03-29 04:06:45 +02:00
|
|
|
#endif /* LIGHTNING_COMMON_DAEMON_H */
|