|
x-engine-c v0.2.13
The C engine for x-lang
|
SIGINT signal handling primitives. More...
Macros | |
| #define | _GNU_SOURCE |
Functions | |
| static void | x_sigint_handler (int sig) |
| static x_obj_t * | x_prim_sigint_install (x_obj_t *p_base, x_obj_t *p_args) |
| static x_obj_t * | x_prim_sigint_restore (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_prim_signal_register (x_obj_t *p_base, x_obj_t *p_args) |
Variables | |
| static x_satom_t | x_sigint_flag = x_obj_set(x_type_atom_obj, X_OBJ_FLAG_NONE, { .i = 0 }) |
SIGINT signal handling primitives.
A static atom's .i field is the SIGINT flag (unavoidable: POSIX handlers receive only the signal number, not an application context). Its pointer is published into the base (x_eval_field_sigint) so x_eval can poll it via p_base rather than naming this module's global. Bound as sigint-flag so x-lang can read/clear it with first-int / set-first-int!.
This is the signal-support module: it is compiled and linked only when X_SIGNAL is enabled (the Makefile drops it from the build otherwise, and the x-lang library falls back to inert no-ops).
| #define _GNU_SOURCE |
Install the SIGINT handler. x-lang: (sigint-install)
Restore default SIGINT handling. x-lang: (sigint-restore)
Register signal primitives and bind sigint-flag.
|
static |
|
static |
Static atom whose .i field is the SIGINT flag. Kept in static (non-heap) storage so the handler can write it without risk of a GC relocation moving it mid-store.