LibCStdlib
Terminates the process through the target C abort path.
Module std.libc.stdlib
import std.libc.stdlib;Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.
<
pub fn<.C> abort() -> never;Terminates the process through the target C abort path.
The call raises the host SIGABRT path, may execute a foreign installed signal handler, does not guarantee stdio flushing, and never returns to Sn.
Return: No value because successful invocation never returns. Pre: Safety: there is no declaration-specific pointer, bounds, alignment, provenance, lifetime, ownership, aliasing, or concurrency obligation. Pre: Safety: the selected libc matches the no-argument C ABI, its process runtime is callable, and no foreign unwind crosses into Sn. Warning: Terminates every process thread without Sn unwind, defer, or automatic deinitialization and may bypass ordinary foreign cleanup.
Example
module example.abort;
from std.libc.stdlib import abort;
fn FatalNow() -> never {
unsafe {
abort();
}
}
fn Main() -> i32 { return 0; }