Files
kolibrios/programs/develop/ktcc/trunk/libc.obj/source/stdlib/_exit.c
Egor00f aa619aa602
Some checks failed
Build system / Check kernel codestyle (pull_request) Successful in 25s
Build system / Build (pull_request) Failing after 1m6s
libc.obj: add copyright & delete _exit.h & fix tabs in crt0.asm
2026-03-07 21:51:58 +05:00

27 lines
458 B
C

#include <conio.h>
#include <stdio.h>
#include <sys/ksys.h>
void _exit(int status)
{
__libc_exit(status, NULL);
}
void __libc_exit(int status, void (*before_exit)(int status))
{
// return error and this is not abort
if (status && status != 128) {
fprintf(stderr, "\nexit code: %d\n", status);
}
if (before_exit) {
before_exit(status);
}
if (__con_is_load) {
con_exit(0);
}
_ksys_exit();
}