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:

  1. it first unblocks the SIGABRT signal ๐Ÿ”“
  2. 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
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms