Documentation for routine signal
Documentation for routine signal, assembled from the following types:
Returns the signal number with which the external process was killed, or 0 or an undefined value otherwise.
sub signal(*, : = )
Creates a supply for the Signal enums (such as SIGINT) specified, and an optional
:scheduler parameter. Any signals received, will be emitted on the supply. For example:
would catch Control-C, thank you, and then exit.
To go from a signal number to a Signal, you can do something like this:
signal(Signal(2)).tap( -> );
The list of supported signals can be found by checking
Signal::.keys (as you would any enum). For more details on how enums work see enum.
Note: Currently Rakudo has a bug which makes it use numeric values of signals that may be incorrect for a particular system. For example,
Signal(10) may return
SIGBUS even if it is actually
SIGUSR1 on your system. RT #132012