GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
sighandlers.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1993-2025 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26/*
27
28The signal blocking macros defined below were adapted from similar
29functions from GNU Bash, the Bourne Again SHell, copyright (C) 1994
30Free Software Foundation, Inc.
31
32*/
33
34// This file should always be included after config.h!
35
36#if ! defined (octave_sighandlers_h)
37#define octave_sighandlers_h 1
38
39#include <atomic>
40
41#include "octave-config.h"
42
43#include "child-list.h"
44
46
47// This type must match the typedef in signal-wrappers.h.
48typedef void sig_handler (int);
49
55
56// Nonzero means we have already printed a message for this series of
57// SIGPIPES. We assume that the writer will eventually give up.
59
60// TRUE means we can be interrupted.
61extern OCTINTERP_API std::atomic<bool> can_interrupt;
62
63extern OCTINTERP_API sig_handler *
65 bool restart_syscalls = true);
66
67extern OCTINTERP_API sig_handler *
68set_signal_handler (const char *signame, sig_handler *h,
69 bool restart_syscalls = true);
70
71extern OCTINTERP_API void install_signal_handlers ();
72
73extern OCTINTERP_API void respond_to_pending_signals ();
74
75extern OCTINTERP_API interrupt_handler catch_interrupts ();
76
77extern OCTINTERP_API interrupt_handler ignore_interrupts ();
78
79extern OCTINTERP_API interrupt_handler
81 bool restart_syscalls = true);
82
83// TRUE means we should try to enter the debugger on SIGINT.
84extern OCTINTERP_API bool Vdebug_on_interrupt;
85
86OCTAVE_END_NAMESPACE(octave)
87
88#endif
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
interrupt_handler ignore_interrupts()
void respond_to_pending_signals()
bool Vdebug_on_interrupt
int pipe_handler_error_count
sig_handler * set_signal_handler(int sig, sig_handler *h, bool restart_syscalls=true)
void sig_handler(int)
Definition sighandlers.h:48
std::atomic< bool > can_interrupt
interrupt_handler catch_interrupts()
void install_signal_handlers()
interrupt_handler set_interrupt_handler(const interrupt_handler &h, bool restart_syscalls=true)
sig_handler * int_handler
Definition sighandlers.h:52
sig_handler * brk_handler
Definition sighandlers.h:53