ekg2  GIT master
Funkcje | Zmienne
Dokumentacja pliku abort.h
#include "plugins.h"
#include <glib.h>
Wykres zależności załączania dla abort.h:
Ten wykres pokazuje, które pliki bezpośrednio lub pośrednio załączają ten plik:

Idź do kodu źródłowego tego pliku.

Funkcje

int ekg2_register_abort_handler (abort_handler handler, plugin_t *plugin)
 
void ekg2_run_all_abort_handlers (void)
 
int ekg2_unregister_abort_handlers_for_plugin (plugin_t *plugin)
 

Zmienne

G_BEGIN_DECLS typedef void(* abort_handler )(void)
 

Dokumentacja funkcji

◆ ekg2_register_abort_handler()

int ekg2_register_abort_handler ( abort_handler  handler,
plugin_t plugin 
)

Statically register the abort handler function for the plugin.

The handler MUST be async-signal-safe (see signal(7)).

Zwraca
1 if successful, 0 if there was no space left.

◆ ekg2_run_all_abort_handlers()

void ekg2_run_all_abort_handlers ( void  )

Run all registered abort handlers (possibly none).

No particular order of invocation is guaranteed.

◆ ekg2_unregister_abort_handlers_for_plugin()

int ekg2_unregister_abort_handlers_for_plugin ( plugin_t plugin)

Unregister all abort handlers for plugin.

Zwraca
the number of unregistered handlers.

Dokumentacja zmiennych

◆ abort_handler

G_BEGIN_DECLS typedef void(* abort_handler) (void)

Statically allocated handlers for fatal signal handling.

The reason for all this is to avoid heap references in fatal signal handlers (which are a big no-no), but still allow plugins to do some rudimentary cleanup. See

Zobacz również
handle_fatal_signal() for more information.

Plugins, during initialization, register their abort handlers using ekg2_register_abort_handler().

The registered abort handlers will be called by core in cases such as receiving a SIGSEGV or SIGABRT.

Core will also unregister all handlers for a given plugin right before unregistering the plugin itself, but there is no harm in the plugin unregistering its own abort handlers if it knows of a more appropriate time.