26 #if defined (HAVE_CONFIG_H)
36 #if defined (OCTAVE_USE_WINDOWS_API)
37 # define WIN32_LEAN_AND_MEAN
90 std::cerr <<
"fatal: caught signal "
92 <<
" -- stopping myself..." << std::endl;
103 throw exit_exception (1);
118 static const bool have_sigint
122 static const bool have_sigbreak
128 static const bool have_sighup
132 static const bool have_sigquit
136 static const bool have_sigterm
142 static const bool have_sigalrm
145 static int sigvtalrm;
146 static const bool have_sigvtalrm
152 static const bool have_sigio
156 static const bool have_siglost
160 static const bool have_sigpipe
166 static const bool have_sigchld
170 static const bool have_sigcld
176 static const bool have_sigxcpu
180 static const bool have_sigxfsz
186 static const bool have_sigusr1
190 static const bool have_sigusr2
201 if ((have_sigchld && sig == sigchld)
202 || (have_sigcld && sig == sigcld))
218 else if (have_sigpipe && sig == sigpipe)
220 std::cerr <<
"warning: broken pipe" << std::endl;
230 else if (have_sighup && sig == sighup)
232 else if (have_sigquit && sig == sigquit)
234 else if (have_sigterm && sig == sigterm)
236 else if ((have_sigalrm && sig == sigalrm)
237 || (have_sigvtalrm && sig == sigvtalrm)
238 || (have_sigio && sig == sigio)
239 || (have_siglost && sig == siglost)
240 || (have_sigxcpu && sig == sigxcpu)
241 || (have_sigxfsz && sig == sigxfsz)
242 || (have_sigusr1 && sig == sigusr1)
243 || (have_sigusr2 && sig == sigusr2))
244 std::cerr <<
"warning: ignoring signal: "
247 else if ((have_sigint && sig == sigint)
248 || (have_sigbreak && sig == sigbreak))
251 std::cerr <<
"warning: ignoring unexpected signal: "
266 bool restart_syscalls)
284 static const bool have_sigint
288 static const bool have_sigbreak
291 if ((have_sigint && sig == sigint)
292 || (have_sigbreak && sig == sigbreak))
308 std::cerr <<
"fatal: caught signal "
310 <<
" -- stopping myself..." << std::endl;
322 std::cerr <<
"warning: floating point exception" << std::endl;
349 bool restart_syscalls)
444 m.assign (&signame[3],
signum);
500 if (args.length () != 0)
515 DEFUN (debug_on_interrupt, args, nargout,
534 "debug_on_interrupt");
549 DEFUN (sighup_dumps_octave_core, args, nargout,
565 "sighup_dumps_octave_core");
580 DEFUN (sigquit_dumps_octave_core, args, nargout,
596 "sigquit_dumps_octave_core");
611 DEFUN (sigterm_dumps_octave_core, args, nargout,
627 "sigterm_dumps_octave_core");
OCTINTERP_API void dump_octave_core(void)
void octave_create_interrupt_watcher_thread(octave_sig_handler *handler)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
OCTINTERP_API void print_usage(void)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
child_list & __get_child_list__(void)
load_save_system & __get_load_save_system__(void)
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
volatile sig_atomic_t octave_signal_caught
sig_atomic_t octave_interrupt_state
static void deadly_sig_handler(int sig)
static octave_scalar_map make_sig_struct(void)
static void my_friendly_exit(int sig, bool save_vars=true)
interrupt_handler set_interrupt_handler(const volatile interrupt_handler &h, bool restart_syscalls)
static bool * signals_caught
void install_signal_handlers(void)
int pipe_handler_error_count
static void set_sig_struct_field(octave_scalar_map &m, const char *signame)
static bool Vsigquit_dumps_octave_core
sig_handler * set_signal_handler(int sig, sig_handler *handler, bool restart_syscalls)
static bool Vsighup_dumps_octave_core
static void fpe_sig_handler(int)
static bool Vsigterm_dumps_octave_core
interrupt_handler ignore_interrupts(void)
static void generic_sig_handler(int sig)
void respond_to_pending_signals(void)
interrupt_handler catch_interrupts(void)
octave_sig_handler * octave_set_default_signal_handler(int sig)
int octave_num_signals(void)
void * octave_block_child(void)
char * octave_strsignal_wrapper(int signum)
void octave_unblock_child(void *context_arg)
bool octave_get_sig_number(const char *signame, int *signum)
int octave_raise_wrapper(int signum)
octave_sig_handler * octave_set_signal_handler_by_name(const char *signame, octave_sig_handler *handler, bool restart_syscalls)
octave_sig_handler * octave_set_signal_handler_internal(int sig, octave_sig_handler *handler, bool restart_syscalls)
sig_handler * int_handler
sig_handler * brk_handler
void sysdep_cleanup(void)
octave_value set_internal_variable(bool &var, const octave_value_list &args, int nargout, const char *nm)