GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
sighandlers.cc File Reference
#include <csignal>
#include <cstdlib>
#include <iostream>
#include <new>
#include "child-list.h"
#include "cmd-edit.h"
#include "oct-syscalls.h"
#include "quit.h"
#include "signal-wrappers.h"
#include "defun.h"
#include "error.h"
#include "input.h"
#include "interpreter-private.h"
#include "interpreter.h"
#include "load-save.h"
#include "octave.h"
#include "oct-map.h"
#include "pager.h"
#include "sighandlers.h"
#include "sysdep.h"
#include "utils.h"
#include "variables.h"
Include dependency graph for sighandlers.cc:

Go to the source code of this file.

Functions

interrupt_handler catch_interrupts (void)
 
static void deadly_sig_handler (int sig)
 
OCTAVE_EXPORT octave_value_list Fdebug_on_interrupt (const octave_value_list &args, int nargout)
 
static void fpe_sig_handler (int)
 
OCTAVE_EXPORT octave_value_list FSIG (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fsighup_dumps_octave_core (const octave_value_list &args, int nargout)
 
OCTAVE_EXPORT octave_value_list Fsigquit_dumps_octave_core (const octave_value_list &args, int nargout)
 
OCTAVE_EXPORT octave_value_list Fsigterm_dumps_octave_core (const octave_value_list &args, int nargout)
 
static void generic_sig_handler (int sig)
 
interrupt_handler ignore_interrupts (void)
 
void install_signal_handlers (void)
 
static octave_scalar_map make_sig_struct (void)
 
static void my_friendly_exit (int sig, bool save_vars=true)
 
void respond_to_pending_signals (void)
 
interrupt_handler set_interrupt_handler (const volatile interrupt_handler &h, bool restart_syscalls)
 
static void set_sig_struct_field (octave_scalar_map &m, const char *signame)
 
sig_handlerset_signal_handler (const char *signame, sig_handler *handler, bool restart_syscalls)
 
sig_handlerset_signal_handler (int sig, sig_handler *handler, bool restart_syscalls)
 

Variables

bool can_interrupt = false
 
int pipe_handler_error_count = 0
 
static bool * signals_caught = nullptr
 
bool Vdebug_on_interrupt = false
 
static bool Vsighup_dumps_octave_core = true
 
static bool Vsigquit_dumps_octave_core = true
 
static bool Vsigterm_dumps_octave_core = true
 

Function Documentation

◆ catch_interrupts()

◆ deadly_sig_handler()

static void deadly_sig_handler ( int  sig)
static

◆ Fdebug_on_interrupt()

OCTAVE_EXPORT octave_value_list Fdebug_on_interrupt ( const octave_value_list args,
int  nargout 
)

Definition at line 531 of file sighandlers.cc.

References set_internal_variable(), and Vdebug_on_interrupt.

◆ fpe_sig_handler()

static void fpe_sig_handler ( int  )
static

Definition at line 318 of file sighandlers.cc.

Referenced by install_signal_handlers().

◆ FSIG()

OCTAVE_EXPORT octave_value_list FSIG ( const octave_value_list args,
int   
)

Definition at line 498 of file sighandlers.cc.

References m, make_sig_struct(), ovl(), and print_usage().

◆ Fsighup_dumps_octave_core()

OCTAVE_EXPORT octave_value_list Fsighup_dumps_octave_core ( const octave_value_list args,
int  nargout 
)

Definition at line 561 of file sighandlers.cc.

References set_internal_variable(), and Vsighup_dumps_octave_core.

◆ Fsigquit_dumps_octave_core()

OCTAVE_EXPORT octave_value_list Fsigquit_dumps_octave_core ( const octave_value_list args,
int  nargout 
)

Definition at line 592 of file sighandlers.cc.

References set_internal_variable(), and Vsigquit_dumps_octave_core.

◆ Fsigterm_dumps_octave_core()

OCTAVE_EXPORT octave_value_list Fsigterm_dumps_octave_core ( const octave_value_list args,
int  nargout 
)

Definition at line 623 of file sighandlers.cc.

References set_internal_variable(), and Vsigterm_dumps_octave_core.

◆ generic_sig_handler()

static void generic_sig_handler ( int  sig)
static

◆ ignore_interrupts()

◆ install_signal_handlers()

◆ make_sig_struct()

static octave_scalar_map make_sig_struct ( void  )
static

Definition at line 448 of file sighandlers.cc.

References m, and set_sig_struct_field().

Referenced by FSIG().

◆ my_friendly_exit()

static void my_friendly_exit ( int  sig,
bool  save_vars = true 
)
static

◆ respond_to_pending_signals()

◆ set_interrupt_handler()

interrupt_handler set_interrupt_handler ( const volatile interrupt_handler h,
bool  restart_syscalls 
)

◆ set_sig_struct_field()

static void set_sig_struct_field ( octave_scalar_map m,
const char *  signame 
)
static

Definition at line 437 of file sighandlers.cc.

References m, octave_get_sig_number(), and signum().

Referenced by make_sig_struct().

◆ set_signal_handler() [1/2]

sig_handler* set_signal_handler ( const char *  signame,
sig_handler handler,
bool  restart_syscalls 
)

Definition at line 265 of file sighandlers.cc.

References octave_set_signal_handler_by_name().

◆ set_signal_handler() [2/2]

sig_handler* set_signal_handler ( int  sig,
sig_handler handler,
bool  restart_syscalls 
)

Variable Documentation

◆ can_interrupt

bool can_interrupt = false

◆ pipe_handler_error_count

int pipe_handler_error_count = 0

Definition at line 65 of file sighandlers.cc.

Referenced by respond_to_pending_signals().

◆ signals_caught

bool* signals_caught = nullptr
static

◆ Vdebug_on_interrupt

◆ Vsighup_dumps_octave_core

bool Vsighup_dumps_octave_core = true
static

Definition at line 76 of file sighandlers.cc.

Referenced by Fsighup_dumps_octave_core(), and respond_to_pending_signals().

◆ Vsigquit_dumps_octave_core

bool Vsigquit_dumps_octave_core = true
static

Definition at line 79 of file sighandlers.cc.

Referenced by Fsigquit_dumps_octave_core(), and respond_to_pending_signals().

◆ Vsigterm_dumps_octave_core

bool Vsigterm_dumps_octave_core = true
static

Definition at line 82 of file sighandlers.cc.

Referenced by Fsigterm_dumps_octave_core(), and respond_to_pending_signals().