Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
Development · Evolving reference

LibCStdlib

Terminates the process through the target C abort path.

Sn is under heavy development. This reference includes the intended 1.0 design; features may be incomplete in the current compiler. Read the status →

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; }
Documentation snapshot: October 24, 2026 About versions ↗
Searching Development · language & standard library