summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomáš Golembiovský <tgolembi@redhat.com>2023-07-26 14:59:30 +0200
committerAlejandro Colomar <alx@kernel.org>2023-07-28 21:27:20 +0200
commite0a36923ddcf1349b8c557ccf6c80fb59b831eff (patch)
tree338932ccefd9683250b89b26361f716d9bb0cfc7
parent80e3024bde68ee3fa55cfd87728b81f94ec931df (diff)
abort.3: Clarify consequences of calling abort()
Clarify that atexit(3)/on_exit(3) are not called because those are called only on normal process termination (as documented on their respective manual pages). Check with the following test program: ```c #define _DEFAULT_SOURCE #include <stdio.h> #include <stdlib.h> void one(void) { puts("atexit called"); } void two(int, void*) { puts("on_exit called"); } int main(void) { atexit(one); on_exit(two, NULL); puts("terminating"); //abort(); exit(EXIT_SUCCESS); } ``` Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: Stefan Puiu <stefan.puiu@gmail.com> Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man3/abort.36
1 files changed, 6 insertions, 0 deletions
diff --git a/man3/abort.3 b/man3/abort.3
index 0b57e10ed..a466d0913 100644
--- a/man3/abort.3
+++ b/man3/abort.3
@@ -47,6 +47,12 @@ function will still terminate the process.
It does this by restoring the default disposition for
.B SIGABRT
and then raising the signal for a second time.
+.PP
+As with other cases of abnormal termination the functions registered with
+.BR atexit (3)
+and
+.BR on_exit (3)
+are not called.
.SH RETURN VALUE
The
.BR abort ()