Skip to content

HandleableSignalValidator

[Source]

Validates that a signal number is handleable via the ASIO mechanism.

Only signals that can be safely caught and dispatched to Pony actors are accepted. Fatal signals (SIGILL, SIGTRAP, SIGABRT, SIGFPE, SIGBUS, SIGSEGV), uncatchable signals (SIGKILL, SIGSTOP), and unknown signal numbers are rejected. SIGUSR2 is accepted only on scheduler_scaling_pthreads builds; on other builds the runtime reserves it for scheduler sleep/wake and Sig.usr2() is a compile error.

Validation is necessary but not sufficient: the operating system can still refuse a registration the whitelist admits (for example, glibc reserves the two lowest real-time signals for its own threading internals, and musl the three lowest). Such a refusal surfaces through the normal failure path — the notify's registration_failed is called and the handler is automatically disposed. Diagnostic runtime builds (use=runtime_tracing) additionally reserve a pause signal — SIGRTMIN on Linux, SIGINFO on BSD and macOS — and handling that signal in such a build breaks runtime tracing.

primitive val HandleableSignalValidator is
  Validator[U32 val] val

Implements


Constructors

create

[Source]

new val create()
: HandleableSignalValidator val^

Returns


Public Functions

apply

[Source]

Return ValidationSuccess for a handleable signal number, or a ValidationFailure naming the rejected number.

fun box apply(
  sig: U32 val)
: ValidationResult

Parameters

Returns


eq

[Source]

fun box eq(
  that: HandleableSignalValidator val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: HandleableSignalValidator val)
: Bool val

Parameters

Returns