23 #if defined (HAVE_CONFIG_H) 33 #if defined (OCTAVE_USE_WINDOWS_API) 34 # define WIN32_LEAN_AND_MEAN 90 std::cerr <<
"fatal: caught signal " 92 <<
" -- stopping myself..." << std::endl;
99 throw exit_exception (1);
114 static const bool have_sigint
118 static const bool have_sigbreak
124 static const bool have_sighup
128 static const bool have_sigquit
132 static const bool have_sigterm
138 static const bool have_sigalrm
141 static int sigvtalrm;
142 static const bool have_sigvtalrm
148 static const bool have_sigio
152 static const bool have_siglost
156 static const bool have_sigpipe
162 static const bool have_sigchld
166 static const bool have_sigcld
172 static const bool have_sigxcpu
176 static const bool have_sigxfsz
182 static const bool have_sigusr1
186 static const bool have_sigusr2
198 if ((have_sigchld && sig == sigchld)
199 || (have_sigcld && sig == sigcld))
215 else if (have_sigpipe && sig == sigpipe)
217 std::cerr <<
"warning: broken pipe" << std::endl;
227 else if (have_sighup && sig == sighup)
229 else if (have_sigquit && sig == sigquit)
231 else if (have_sigterm && sig == sigterm)
233 else if ((have_sigalrm && sig == sigalrm)
234 || (have_sigvtalrm && sig == sigvtalrm)
235 || (have_sigio && sig == sigio)
236 || (have_siglost && sig == siglost)
237 || (have_sigxcpu && sig == sigxcpu)
238 || (have_sigxfsz && sig == sigxfsz)
239 || (have_sigusr1 && sig == sigusr1)
240 || (have_sigusr2 && sig == sigusr2))
241 std::cerr <<
"warning: ignoring signal: " 244 else if ((have_sigint && sig == sigint)
245 || (have_sigbreak && sig == sigbreak))
248 std::cerr <<
"warning: ignoring unexpected signal: " 263 bool restart_syscalls)
281 static const bool have_sigint
285 static const bool have_sigbreak
288 if ((have_sigint && sig == sigint)
289 || (have_sigbreak && sig == sigbreak))
305 std::cerr <<
"fatal: caught signal " 307 <<
" -- stopping myself..." << std::endl;
319 std::cerr <<
"warning: floating point exception" << std::endl;
346 bool restart_syscalls)
498 if (args.length () != 0)
532 "debug_on_interrupt");
563 "sighup_dumps_octave_core");
594 "sigquit_dumps_octave_core");
625 "sigterm_dumps_octave_core");
volatile sig_atomic_t octave_signal_caught
child_list & __get_child_list__(const std::string &who)
octave_sig_handler * octave_set_default_signal_handler(int sig)
OCTINTERP_API void print_usage(void)
interrupt_handler catch_interrupts(void)
octave_sig_handler * octave_set_signal_handler_internal(int sig, octave_sig_handler *handler, bool restart_syscalls)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void * octave_block_child(void)
static llvm::LLVMContext & context
void sysdep_cleanup(void)
static octave_scalar_map make_sig_struct(void)
void respond_to_pending_signals(void)
sig_handler * set_signal_handler(int sig, sig_handler *handler, bool restart_syscalls)
void octave_unblock_child(void *context_arg)
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
int pipe_handler_error_count
void octave_create_interrupt_watcher_thread(octave_sig_handler *handler)
static void set_sig_struct_field(octave_scalar_map &m, const char *signame)
sig_atomic_t octave_interrupt_state
int octave_num_signals(void)
interrupt_handler ignore_interrupts(void)
static void my_friendly_exit(int sig, bool save_vars=true)
end deftypefn *return set_internal_variable(Vsvd_driver, args, nargout, "svd_driver", driver_names)
static bool Vsigquit_dumps_octave_core
int octave_raise_wrapper(int signum)
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).isinteger())
static void deadly_sig_handler(int sig)
static bool Vsigterm_dumps_octave_core
void assign(const std::string &k, const octave_value &val)
static bool Vsighup_dumps_octave_core
interrupt_handler set_interrupt_handler(const volatile interrupt_handler &h, bool restart_syscalls)
static bool * signals_caught
bool octave_get_sig_number(const char *signame, int *signum)
octave_sig_handler * octave_set_signal_handler_by_name(const char *signame, octave_sig_handler *handler, bool restart_syscalls)
static void fpe_sig_handler(int)
static void generic_sig_handler(int sig)
void install_signal_handlers(void)
static size_t save_vars(std::ostream &os, const std::string &pattern, load_save_format fmt, bool save_as_floats)
static void dump_octave_core(std::ostream &os, const char *fname, load_save_format fmt, bool save_as_floats)
char * octave_strsignal_wrapper(int signum)