diff options
Diffstat (limited to 'src/fastd.h')
-rw-r--r-- | src/fastd.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fastd.h b/src/fastd.h index f69f2f8..eeb2d3d 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -292,6 +292,11 @@ struct fastd_string_stack { extern fastd_context_t ctx; extern fastd_config_t conf; +extern volatile bool fastd_sig_hup; +extern volatile bool fastd_sig_terminate; +extern volatile bool fastd_sig_dump; +extern volatile bool fastd_sig_chld; + void fastd_send(const fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_peer_t *peer, fastd_buffer_t buffer, size_t stat_size); void fastd_send_handshake(const fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_peer_t *peer, fastd_buffer_t buffer); @@ -371,6 +376,11 @@ static inline size_t alignto(size_t l, size_t a) { return block_count(l, a)*a; } +/** Returns true if any unhandled signal in currently queued */ +static inline bool fastd_signalled(void) { + return (fastd_sig_hup || fastd_sig_terminate || fastd_sig_dump || fastd_sig_chld); +} + /** Returns the maximum payload size \em fastd is configured to transport */ static inline size_t fastd_max_payload(void) { switch (conf.mode) { |