Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
system_signal_handling.c File Reference
#include "common/darktable.h"
#include "common/file_location.h"
#include "common/system_signal_handling.h"
#include <errno.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <limits.h>
#include <signal.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
+ Include dependency graph for system_signal_handling.c:

Macros

#define _NUM_SIGNALS_TO_PRESERVE   (sizeof(_signals_to_preserve) / sizeof(_signals_to_preserve[0]))
 defined (_WIN32)
 

Typedefs

typedef void() dt_signal_handler_t(int)
 

Functions

static void _dt_sigsegv_handler (int param)
 
void dt_set_signal_handlers ()
 

Variables

static dt_signal_handler_t_dt_sigsegv_old_handler = NULL
 
static const int _signals_to_preserve []
 
static dt_signal_handler_t_orig_sig_handlers [(sizeof(_signals_to_preserve)/sizeof(_signals_to_preserve[0]))] = { NULL }
 
static int _times_handlers_were_set = 0
 

Macro Definition Documentation

◆ _NUM_SIGNALS_TO_PRESERVE

#define _NUM_SIGNALS_TO_PRESERVE   (sizeof(_signals_to_preserve) / sizeof(_signals_to_preserve[0]))

defined (_WIN32)

Typedef Documentation

◆ dt_signal_handler_t

typedef void() dt_signal_handler_t(int)

Function Documentation

◆ _dt_sigsegv_handler()

static void _dt_sigsegv_handler ( int  param)
static

◆ dt_set_signal_handlers()

void dt_set_signal_handlers ( )
Todo:
: what about SIGABRT?

defined(APPLE) && !defined(_WIN32)

References _dt_sigsegv_handler(), _dt_sigsegv_old_handler, _NUM_SIGNALS_TO_PRESERVE, _orig_sig_handlers, _signals_to_preserve, _times_handlers_were_set, and void().

Referenced by dt_init().

Variable Documentation

◆ _dt_sigsegv_old_handler

dt_signal_handler_t* _dt_sigsegv_old_handler = NULL
static

◆ _orig_sig_handlers

dt_signal_handler_t* _orig_sig_handlers[(sizeof(_signals_to_preserve)/sizeof(_signals_to_preserve[0]))] = { NULL }
static

Referenced by dt_set_signal_handlers().

◆ _signals_to_preserve

const int _signals_to_preserve[]
static
Initial value:
= { SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGABRT, SIGBUS, SIGFPE,
SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGXCPU, SIGXFSZ }

Referenced by dt_set_signal_handlers().

◆ _times_handlers_were_set

int _times_handlers_were_set = 0
static

Referenced by dt_set_signal_handlers().