vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function EventDriverSignals.listen

Starts listening for the specified POSIX signal.

abstract SignalListenID listen (
  int sig,
  nothrow @safe void delegate(SignalListenID, SignalStatus, int) on_signal
) nothrow @safe;

Note that if a default signal handler exists for the signal, it will be disabled by using this function.

Parameters

NameDescription
sig The number of the signal to listen for
on_signal Callback that gets called whenever a matching signal gets received

Returns

Returns an identifier that identifies the resource associated with the signal. Giving up ownership of this resource using releaseRef will re-enable the default signal handler, if any was present.

For any error condition, SignalListenID.invalid will be returned instead.

Authors
Copyright
License