Unix style signals for Unix and Windows. SIGKILL and SIGSTOP are missing because they cannot be caught. SIGBUS, SIGFPE, SIGILL, and SIGSEGV are missing because they cannot be caught safely. SIGPIPE is not present because the runtime ignores the signal.
- sighup : Signal
Hangup detected on controlling terminal or death of controlling process.
On Windows:
- SIGHUP is generated when the user closes the console window. The program is given ~10 seconds to perform cleanup before Windows unconditionally terminates it.
- sigint : Signal
Interrupt program.
Notes:
- Normally delivered when the user presses CTRL+C. Not generated when terminal raw mode is enabled.
- sigquit : Signal
Quit program.
- sigtrap : Signal
Trace/breakpoint trap.
- sigabrt : Signal
Abort signal.
Notes:
- SIGABRT is not catchable if generated by certain runtime functions, such as abort or assertion failure.
- On Windows, watchers can be created for SIGABRT, but they never receive the signal.
- sigusr1 : Signal
User-defined signal 1.
- sigusr2 : Signal
User-defined signal 2.
- sigalrm : Signal
Real-time timer expired.
- sigterm : Signal
Termination signal.
Notes:
- On Windows, watchers can be created for SIGTERM, but they never receive the signal.
- sigchld : Signal
Child status has changed.
- sigcont : Signal
Continue after stop.
- sigtstp : Signal
Stop typed at terminal.
- sigttin : Signal
Background read attempted from control terminal.
- sigttou : Signal
Background write attempted to control terminal.
- sigurg : Signal
Urgent condition on socket.
- sigxcpu : Signal
CPU time limit exceeded.
- sigxfsz : Signal
File size limit exceeded.
- sigvtalrm : Signal
Virtual alarm clock.
- sigprof : Signal
Profiling timer expired.
- sigwinch : Signal
Window size change.
Notes:
- SIGWINCH is raised whenever the runtime detects the console has been resized.
- Under console emulators, or on 32-bit apps on 64-bit systems, SIGWINCH is emulated.
- In these cases, signals may not be delivered timely.
- sigio : Signal
I/O now possible.
- sigsys : Signal
Bad system call.
Instances For
Equations
- Std.Async.instReprSignal = { reprPrec := Std.Async.instReprSignal.repr }
Equations
- Std.Async.instReprSignal.repr Std.Async.Signal.sighup prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sighup")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigint prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigint")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigquit prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigquit")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigtrap prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigtrap")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigabrt prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigabrt")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigusr1 prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigusr1")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigusr2 prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigusr2")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigalrm prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigalrm")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigterm prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigterm")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigchld prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigchld")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigcont prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigcont")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigtstp prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigtstp")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigttin prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigttin")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigttou prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigttou")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigurg prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigurg")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigxcpu prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigxcpu")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigxfsz prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigxfsz")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigvtalrm prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigvtalrm")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigprof prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigprof")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigwinch prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigwinch")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigio prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigio")).group prec✝
- Std.Async.instReprSignal.repr Std.Async.Signal.sigsys prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Std.Async.Signal.sigsys")).group prec✝
Instances For
Equations
Equations
- Std.Async.instBEqSignal.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Signal.Waiter can be used to wait for a specific signal.
- ofNative :: (
- native : Internal.UV.Signal
- )
Instances For
Set up a Signal.Waiter that waits for the specified signum.
This function only initializes but does not yet start listening for the signal.
While the waiter listens for the signal, the default action of the signal is replaced. A waiter
that is no longer referenced can keep listening if the last operation that reached it was wait: a
one-shot waiter until the signal arrives, a repeating one for the rest of the process. After a
select that checked it, it stops listening once it is dropped. stop stops it in every case.
Equations
- Std.Async.Signal.Waiter.mk signum repeating = do let native ← Std.Internal.UV.Signal.mk (Std.Async.Signal.toInt32✝ signum) repeating pure { native := native }
Instances For
If:
sis not yet running start listening and return anAsyncTaskthat will resolve once the previously configured signal is received.sis running, or is a one-shotsthat finished after receiving the signal, return anAsyncTaskfor the pending signal, which is the one returned by the previous call unless that one resolved (for a repeatings) or a select that did not find the signal already received dropped it. Tasks whose promise was dropped fail.swas stopped withstop, and is repeating or had not received the signal, return anAsyncTaskthat fails.
The resolved AsyncTask contains the number that Signal assigns to the received signal, which is
the same on every platform (the x86 Linux numbering).
Instances For
If:
sis still running this stopsswithout resolving any remainingAsyncTasks that were created throughwait. Those tasks fail once the last reference to their promise is dropped, rather than producing a value.sis not yet or not anymore running this is a no-op.
Instances For
Create a Selector that resolves once s has received the signal. Calling this function does not
start the signal waiter: a select starts it when it checks it, and it may not check it at all if
another selector is already ready.
A select that checks s without picking it leaves it listening until stop is called or s is
dropped, and a signal that arrives afterwards is kept and reported by the next select that checks
s. For a repeating s, a signal that arrives while another selector wins the same select may be
lost.
Equations
- One or more equations did not get rendered due to their size.