mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-06 18:18:51 +00:00
130f2266d0
fish's signal handlers are now sufficiently innocuous that there should be no reason to block signals (outside of temporarily, when creating a thread and we need to manipulate the signal mask).
35 lines
1 KiB
C
35 lines
1 KiB
C
// The library for various signal related issues.
|
|
#ifndef FISH_SIGNALH
|
|
#define FISH_SIGNALH
|
|
|
|
#include <signal.h>
|
|
|
|
/// Get the integer signal value representing the specified signal, or -1 of no signal was found.
|
|
int wcs2sig(const wchar_t *str);
|
|
|
|
/// Get string representation of a signal.
|
|
const wchar_t *sig2wcs(int sig);
|
|
|
|
/// Returns a description of the specified signal.
|
|
const wchar_t *signal_get_desc(int sig);
|
|
|
|
/// Set all signal handlers to SIG_DFL.
|
|
void signal_reset_handlers();
|
|
|
|
/// Set signal handlers to fish default handlers.
|
|
void signal_set_handlers();
|
|
|
|
/// Tell fish what to do on the specified signal.
|
|
///
|
|
/// \param sig The signal to specify the action of
|
|
/// \param do_handle If true fish will catch the specified signal and fire an event, otherwise the
|
|
/// default action (SIG_DFL) will be set
|
|
void signal_handle(int sig, int do_handle);
|
|
|
|
/// Ensure we did not inherit any blocked signals. See issue #3964.
|
|
void signal_unblock_all();
|
|
|
|
/// Returns signals with non-default handlers.
|
|
void get_signals_with_handlers(sigset_t *set);
|
|
|
|
#endif
|