abort.3: Starting with glibc 2.27, abort() does not attempt to flush streams

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-10-08 15:28:43 +02:00
parent be98c938b5
commit 46dc471b8d
1 changed files with 15 additions and 5 deletions

View File

@ -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