EnderIce2 1824c99ca0
Some checks failed
Build OS / Deploy Documentation to GitHub Pages (push) Failing after 9m48s
Build OS / Build Cross-Compiler & Toolchain (push) Successful in 1h57m16s
Build OS / Analyze (${{ matrix.language }}) (manual, c-cpp) (push) Failing after 6m20s
Build OS / Build amd64 (push) Failing after 6m19s
Build OS / Build aarch64 (push) Failing after 6m20s
Build OS / Build arm (push) Failing after 6m17s
Build OS / Build i386 (push) Failing after 19m15s
userspace/libc: flush stdout & stderr on exit
Signed-off-by: EnderIce2 <enderice2@protonmail.com>
2025-01-25 00:16:58 +02:00

39 lines
1017 B
C

/*
This file is part of Fennix Userspace.
Fennix Userspace is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
Fennix Userspace is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Fennix Userspace. If not, see <https://www.gnu.org/licenses/>.
*/
#include <fennix/syscalls.h>
#include <stdio.h>
int __init_pthread(void);
void __init_stdio(void);
__attribute__((visibility("default"))) void __libc_init(void)
{
__init_pthread();
__init_stdio();
}
__attribute__((visibility("default"))) void _exit(int Code)
{
fflush(stdout);
fflush(stderr);
call_exit(Code);
while (1)
;
}