libc.obj: add abort && add exit and _exit to stdlib.h and libc.def
This commit is contained in:
@@ -47,11 +47,13 @@ vsscanf
|
||||
ungetc
|
||||
;____STDLIB____
|
||||
abs
|
||||
abort
|
||||
atoi
|
||||
atol
|
||||
atoll
|
||||
atof
|
||||
calloc
|
||||
_exit
|
||||
exit
|
||||
free
|
||||
itoa
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 },
|
||||
|
||||
12
programs/develop/ktcc/trunk/libc.obj/source/stdlib/abort.c
Normal file
12
programs/develop/ktcc/trunk/libc.obj/source/stdlib/abort.c
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user