libc.obj: add abort && add exit and _exit to stdlib.h and libc.def
Some checks failed
Build system / Build (pull_request) Failing after 2s
Build system / Check kernel codestyle (pull_request) Successful in 24s

This commit is contained in:
2026-02-22 14:03:16 +05:00
parent ba8747e2ab
commit f675fd31b7
4 changed files with 22 additions and 0 deletions

View File

@@ -47,11 +47,13 @@ vsscanf
ungetc
;____STDLIB____
abs
abort
atoi
atol
atoll
atof
calloc
_exit
exit
free
itoa

View File

@@ -48,7 +48,13 @@ DLLAPI void free(void* ptr);
DLLAPI long int strtol(const char* str, char** endptr, int base);
DLLAPI void _exit(int status);
#ifndef _Exit
#define _Exit(status) _exit(status);
#endif
DLLAPI void exit(int status);
DLLAPI void abort();
DLLAPI void srand(unsigned s);
DLLAPI int rand(void);

View File

@@ -103,6 +103,7 @@
#include "stdlib/realloc.c"
#include "stdlib/strtod.c"
#include "stdlib/strtol.c"
#include "stdlib/abort.c"
#include "math/acosh.c"
#include "math/asinh.c"
@@ -175,6 +176,7 @@ ksys_dll_t EXPORTS[] = {
{ "calloc", &calloc },
{ "_exit", &_exit },
{ "exit", &exit },
{ "abort", &abort },
{ "free", &free },
{ "itoa", &itoa },
{ "labs", &labs },

View File

@@ -0,0 +1,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/ksys.h>
void abort()
{
ksys_thread_t t;
_ksys_thread_info(&t, -1);
fprintf(stderr, "\nAbort in %d\n", t.pid);
_exit(128);
}