GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Macros | Functions | Variables
sighandlers.cc File Reference
#include <cstdlib>
#include <iostream>
#include <new>
#include <sys/types.h>
#include <unistd.h>
#include "cmd-edit.h"
#include "oct-syscalls.h"
#include "quit.h"
#include "singleton-cleanup.h"
#include "debug.h"
#include "defun.h"
#include "error.h"
#include "input.h"
#include "load-save.h"
#include "oct-map.h"
#include "pager.h"
#include "pt-bp.h"
#include "pt-eval.h"
#include "sighandlers.h"
#include "sysdep.h"
#include "syswait.h"
#include "toplev.h"
#include "utils.h"
#include "variables.h"
Include dependency graph for sighandlers.cc:

Go to the source code of this file.

Classes

class  pid_equal
 

Macros

#define BADSIG   (void (*)(int))-1
 
#define BLOCK_CHILD(nvar, ovar)   BLOCK_SIGNAL (SIGCHLD, nvar, ovar)
 
#define BLOCK_SIGNAL(sig, nvar, ovar)
 
#define OCL_REP   octave_child_list::octave_child_list_rep
 
#define UNBLOCK_CHILD(ovar)   GNULIB_NAMESPACE::sigprocmask (SIG_SETMASK, &ovar, 0)
 

Functions

OCTAVE_EXPORT octave_value_list Fdebug_on_interrupt (const octave_value_list &args, int nargout)
 
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 Fsigterm_dumps_octave_core (const octave_value_list &args, int nargout)
 
static void generic_sig_handler (int sig)
 
void install_signal_handlers (void)
 
static octave_scalar_map make_sig_struct (void)
 
static void my_friendly_exit (const char *sig_name, int sig_number, bool save_vars=true)
 
octave_interrupt_handler octave_catch_interrupts (void)
 
octave_interrupt_handler octave_ignore_interrupts (void)
 
octave_interrupt_handler octave_set_interrupt_handler (const volatile octave_interrupt_handler &h, bool restart_syscalls)
 
sig_handleroctave_set_signal_handler (int sig, sig_handler *handler, bool restart_syscalls)
 
void octave_signal_handler (void)
 
static void sigint_handler (int sig)
 
static void user_abort (const char *sig_name, int sig_number)
 

Variables

bool can_interrupt = false
 
static bool octave_signals_caught [NSIG]
 
int pipe_handler_error_count = 0
 
bool Vdebug_on_interrupt = false
 
static bool Vsighup_dumps_octave_core = true
 
static bool Vsigterm_dumps_octave_core = true
 

Macro Definition Documentation

#define BADSIG   (void (*)(int))-1

Definition at line 233 of file sighandlers.cc.

#define BLOCK_CHILD (   nvar,
  ovar 
)    BLOCK_SIGNAL (SIGCHLD, nvar, ovar)

Definition at line 262 of file sighandlers.cc.

Referenced by octave_signal_handler().

#define BLOCK_SIGNAL (   sig,
  nvar,
  ovar 
)
Value:
do \
{ \
GNULIB_NAMESPACE::sigemptyset (&nvar); \
GNULIB_NAMESPACE::sigaddset (&nvar, sig); \
GNULIB_NAMESPACE::sigemptyset (&ovar); \
GNULIB_NAMESPACE::sigprocmask (SIG_BLOCK, &nvar, &ovar); \
} \
while (0)

Definition at line 248 of file sighandlers.cc.

Definition at line 980 of file sighandlers.cc.

#define UNBLOCK_CHILD (   ovar)    GNULIB_NAMESPACE::sigprocmask (SIG_SETMASK, &ovar, 0)

Definition at line 263 of file sighandlers.cc.

Referenced by octave_signal_handler().

Function Documentation

OCTAVE_EXPORT octave_value_list Fdebug_on_interrupt ( const octave_value_list args,
int  nargout 
)

Definition at line 1092 of file sighandlers.cc.

References SET_INTERNAL_VARIABLE.

OCTAVE_EXPORT octave_value_list FSIG ( const octave_value_list args,
int   
)

Definition at line 1053 of file sighandlers.cc.

References make_sig_struct(), and print_usage().

OCTAVE_EXPORT octave_value_list Fsighup_dumps_octave_core ( const octave_value_list args,
int  nargout 
)

Definition at line 1121 of file sighandlers.cc.

References SET_INTERNAL_VARIABLE.

OCTAVE_EXPORT octave_value_list Fsigterm_dumps_octave_core ( const octave_value_list args,
int  nargout 
)

Definition at line 1150 of file sighandlers.cc.

References SET_INTERNAL_VARIABLE.

static void generic_sig_handler ( int  sig)
static

Definition at line 394 of file sighandlers.cc.

References my_friendly_exit(), and strsignal().

Referenced by install_signal_handlers().

void install_signal_handlers ( void  )
static octave_scalar_map make_sig_struct ( void  )
static

Definition at line 756 of file sighandlers.cc.

References octave_scalar_map::assign().

Referenced by FSIG().

static void my_friendly_exit ( const char sig_name,
int  sig_number,
bool  save_vars = true 
)
static
octave_interrupt_handler octave_catch_interrupts ( void  )
octave_interrupt_handler octave_ignore_interrupts ( void  )

Definition at line 583 of file sighandlers.cc.

References octave_set_signal_handler().

Referenced by do_edit_history(), octave_kbhit(), and octave_signal_handler().

octave_interrupt_handler octave_set_interrupt_handler ( const volatile octave_interrupt_handler h,
bool  restart_syscalls 
)

Definition at line 603 of file sighandlers.cc.

References octave_set_signal_handler().

Referenced by do_edit_history(), octave_kbhit(), and octave_signal_handler().

sig_handler* octave_set_signal_handler ( int  sig,
sig_handler handler,
bool  restart_syscalls 
)
void octave_signal_handler ( void  )
static void sigint_handler ( int  sig)
static

Definition at line 538 of file sighandlers.cc.

References strsignal(), and user_abort().

Referenced by octave_catch_interrupts().

static void user_abort ( const char sig_name,
int  sig_number 
)
static

Variable Documentation

bool can_interrupt = false
bool octave_signals_caught[NSIG]
static

Definition at line 75 of file sighandlers.cc.

Referenced by install_signal_handlers(), and octave_signal_handler().

int pipe_handler_error_count = 0

Definition at line 58 of file sighandlers.cc.

Referenced by octave_base_reader::octave_gets().

bool Vdebug_on_interrupt = false

Definition at line 64 of file sighandlers.cc.

Referenced by tree_jit::enabled(), and user_abort().

bool Vsighup_dumps_octave_core = true
static

Definition at line 69 of file sighandlers.cc.

bool Vsigterm_dumps_octave_core = true
static

Definition at line 72 of file sighandlers.cc.