27 lines
458 B
C
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();
|
|
}
|