abort(3)
โจ abort(3) โจ
okay bestie, so this is a page from the Library Functions Manual and it's about the one and only abort() ๐
she lives in section 3, she's dramatic, she ends things. let's get into it ๐ซถ
๐ธ NAME ๐ธ
abort โ cause abnormal process termination
like. she doesn't do a cute little graceful exit. she does the other thing ๐ญ
๐ LIBRARY ๐
Standard C library (libc, -lc)
โจ SYNOPSIS โจ
#include <stdlib.h>
[[noreturn]] void abort(void);
note the [[noreturn]] bestie, that's the compiler being told "she is NOT coming back" and it is not joking ๐ซถ
๐ DESCRIPTION ๐
So here's the tea. The abort() function does two things, in order:
- it first unblocks the
SIGABRTsignal ๐ - and then it raises that signal for the calling process (exactly as though
raise(3)had been called) ๐ฅ
That results in the abnormal termination of the process โ unless the SIGABRT signal is caught and the signal handler does not return (peep longjmp(3) for that whole situation ๐).
and like. if you think you can dodge her? no. If the SIGABRT signal is ignored, or it's caught by a handler that returns, the abort() function will still terminate the process ๐ She does this by restoring the default disposition for SIGABRT and then raising the signal for a second time. round two. she's not asking. periodt.
Also, just like with other cases of abnormal termination, the functions registered with atexit(3) and on_exit(3) are not called ๐ no goodbye party, no cleanup, nothing.
๐ RETURN VALUE ๐
The abort() function never returns.
that's it. that's the whole section. iconic behaviour honestly ๐
๐ฆ ATTRIBUTES ๐ฆ
For an explanation of the terms used in this section, see attributes(7).
- Interface:
abort() - Attribute: Thread safety
- Value:
MT-Safe
so yeah, she's MT-Safe โ safe to call from multiple threads, no cap โจ
๐ STANDARDS ๐
C11, POSIX.1-2008.
๐ HISTORY ๐
SVr4, POSIX.1-2001, 4.3BSD, C89. ancient. legendary. she's been ending processes since forever ๐
okay but here's the important lore ifykyk. Up until glibc 2.26, if the abort() function caused process termination, all open streams were closed and flushed (as with fclose(3)). sounds nice right? wrong ๐ซ Because in some cases this could result in deadlocks and data corruption ๐ญ
Therefore, starting with glibc 2.27, abort() terminates the process without flushing streams.
And POSIX.1 permits either possible behavior, saying that abort() "may include an attempt to effect fclose() on all open streams". so both vibes are legal, glibc just picked the safer one ๐ซถ
โญ SEE ALSO โญ
ok that's the whole page bestie ๐ remember: abort() is for when you truly need the process to be gone, and she will absolutely make that happen no matter what you try ๐
this slay of a page comes to you from Linux man-pages 6.20, dated 2026-02-08 โ abort(3), out ๐
โจ
๐ฆ where this page comes from
- arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- ๐ the page's license: Linux-man-pages-copyleft
- Copyright 2007, Michael Kerrisk <mtk.manpages@gmail.com>
- Copyright 1993, David Metcalfe <david@prism.demon.co.uk>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms