abla/process/signal

Generated from source.

Import with import "abla/process/signal".

Source: abla/process/signal/entry.ab

signalHangup (val)

val signalHangup

Linux signal number for a terminal hangup (SIGHUP).

signalInterrupt (val)

val signalInterrupt

Linux signal number for a keyboard interrupt (SIGINT).

signalTerminate (val)

val signalTerminate

Linux signal number for a termination request (SIGTERM).

SignalWatch (class)

class SignalWatch(val descriptor: int, val started: bool, val mask: int = 0,
    val closed: Cell<bool> = Cell(false))

A signal's first watch records its caller's bit; overlapping watches keep it blocked until the last one closes, even if they close out of order. The close state is shared by aliases and can be set through a borrowed watch.

watchSignals (fun)

trusted fun watchSignals(signals: array<int>): SignalWatch

From here on these signals don't end the program: received says when one came. Children started after this get them as usual.

SignalWatch.received (extension fun)

trusted fun SignalWatch.received(timeoutMilliseconds: int = 0): int

The next signal that came, waiting up to timeoutMilliseconds (-1: as long as it takes), or 0 if none did.

Command.runWatching (extension fun)

fun Command.runWatching(watch: SignalWatch, graceMilliseconds: int = 5000): int

Runs the command to its end, as run does, unless a watched signal comes: then it stops the command (TERM, and KILL after graceMilliseconds) and gives 128 + the signal, for the program to clean up and leave.

SignalWatch.close (extension fun)

trusted fun SignalWatch.close(): void

Back to how signals were: any still pending take effect as this returns.

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.