Module signal

Module signal 

Source
Available on Windows and crate feature signals only.
Expand description

C signal support on Windows.

A big difference from POSIX platforms is the amount of signals that Windows supports. Signals on Windows are therefore much less useful than POSIX ones.

§Signal safe C functions

The C standard specifies that calling any functions other than those ones from a signal hook results in undefined behavior:

  • abort
  • _Exit
  • quick_exit
  • signal, but only if it is used for setting a handler for the same signal as the one being currently handled
  • atomic C functions, but only the ones which are lock-free (practically never used in Rust since it has its own atomics which use compiler intrinsics)
  • atomic_is_lock_free

Structs§

NoReturnSignalHook
A function which can be used as a signal handler, but one which also never returns.
SignalHook
A function which can be used as a signal handler.
UnknownSignalError
Error type returned when a conversion from i32/u32 to SignalType fails.

Enums§

SetHandlerError
The error produced when setting a signal handler fails.
SignalHandler
A signal handling method.
SignalType
All standard signal types as defined in the C standard.

Functions§

set_handler
Installs the specified handler for the specified signal.
set_unsafe_handler
Installs the specified handler for the specified unsafe signal.