From 46dc471b8d34fbc83cfde440069dbe2ebec8cd3f Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sun, 8 Oct 2017 15:28:43 +0200 Subject: [PATCH] abort.3: Starting with glibc 2.27, abort() does not attempt to flush streams Signed-off-by: Michael Kerrisk --- man3/abort.3 | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/man3/abort.3 b/man3/abort.3 index 5bfc15f18..e011c5d7c 100644 --- a/man3/abort.3 +++ b/man3/abort.3 @@ -56,11 +56,6 @@ signal is caught and the signal handler does not return .BR longjmp (3)). .PP If the -.BR abort () -function causes process termination, -all open streams are closed and flushed. -.PP -If the .B SIGABRT signal is ignored, or caught by a handler that returns, the .BR abort () @@ -84,6 +79,21 @@ T{ .BR abort () T} Thread safety MT-Safe .TE +.SH NOTES +Up until glibc 2.26, +if the +.BR abort () +function caused process termination, +all open streams were closed and flushed (as with +.BR fclose (3)). +However, in some cases this could result in deadlocks and data corruption. +Therefore, starting with glibc 2.27, +.\" glibc commit 91e7cf982d0104f0e71770f5ae8e3faf352dea9f +.BR abort () +terminates the process without flushing streams. +POSIX.1 permits either possible behavior, saying that +.BR abort () +"may include an attempt to effect fclose() on all open streams". .SH CONFORMING TO SVr4, POSIX.1-2001, POSIX.1-2008, 4.3BSD, C89, C99. .SH SEE ALSO