libc: Flush all open streams on exit

This does nothing for now, but prepares for buffering.
This commit is contained in:
apio 2023-07-21 22:56:03 +02:00
parent 5458286309
commit cfb0ead2d9
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -1,3 +1,4 @@
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
typedef void (*atexit_func_t)(void); typedef void (*atexit_func_t)(void);
@ -23,6 +24,8 @@ extern "C"
{ {
while (atexit_registered_funcs--) { atexit_funcs[atexit_registered_funcs](); } while (atexit_registered_funcs--) { atexit_funcs[atexit_registered_funcs](); }
fflush(NULL);
_Exit(status); _Exit(status);
} }
} }