1 #ifndef LIGHTNING_COMMON_DAEMON_H
2 #define LIGHTNING_COMMON_DAEMON_H
3 #include "config.h"
4 #include <poll.h>
5 
6 /* Common setup for all daemons */
7 void daemon_setup(const char *argv0,
8 		  void (*backtrace_print)(const char *fmt, ...),
9 		  void (*backtrace_exit)(void));
10 
11 /* Exposed for lightningd's use. */
12 int daemon_poll(struct pollfd *fds, nfds_t nfds, int timeout);
13 
14 /* Print a backtrace to stderr, and via backtrace_print */
15 void send_backtrace(const char *why);
16 
17 /* Shutdown for a valgrind-clean exit (frees everything) */
18 void daemon_shutdown(void);
19 
20 /* Kick in a debugger if they set --debugger */
21 void daemon_maybe_debug(char *argv[]);
22 
23 #endif /* LIGHTNING_COMMON_DAEMON_H */
24