From cfb0ead2d910bb500ead17799fe265b646bde521 Mon Sep 17 00:00:00 2001 From: apio Date: Fri, 21 Jul 2023 22:56:03 +0200 Subject: [PATCH] libc: Flush all open streams on exit This does nothing for now, but prepares for buffering. --- libc/src/atexit.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libc/src/atexit.cpp b/libc/src/atexit.cpp index 94f86e08..74628b44 100644 --- a/libc/src/atexit.cpp +++ b/libc/src/atexit.cpp @@ -1,3 +1,4 @@ +#include #include typedef void (*atexit_func_t)(void); @@ -23,6 +24,8 @@ extern "C" { while (atexit_registered_funcs--) { atexit_funcs[atexit_registered_funcs](); } + fflush(NULL); + _Exit(status); } }