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
|
ungetc
|
||||||
;____STDLIB____
|
;____STDLIB____
|
||||||
abs
|
abs
|
||||||
|
abort
|
||||||
atoi
|
atoi
|
||||||
atol
|
atol
|
||||||
atoll
|
atoll
|
||||||
atof
|
atof
|
||||||
calloc
|
calloc
|
||||||
|
_exit
|
||||||
exit
|
exit
|
||||||
free
|
free
|
||||||
itoa
|
itoa
|
||||||
|
|||||||
@@ -48,7 +48,13 @@ DLLAPI void free(void* ptr);
|
|||||||
|
|
||||||
DLLAPI long int strtol(const char* str, char** endptr, int base);
|
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 exit(int status);
|
||||||
|
DLLAPI void abort();
|
||||||
|
|
||||||
DLLAPI void srand(unsigned s);
|
DLLAPI void srand(unsigned s);
|
||||||
DLLAPI int rand(void);
|
DLLAPI int rand(void);
|
||||||
|
|||||||
@@ -103,6 +103,7 @@
|
|||||||
#include "stdlib/realloc.c"
|
#include "stdlib/realloc.c"
|
||||||
#include "stdlib/strtod.c"
|
#include "stdlib/strtod.c"
|
||||||
#include "stdlib/strtol.c"
|
#include "stdlib/strtol.c"
|
||||||
|
#include "stdlib/abort.c"
|
||||||
|
|
||||||
#include "math/acosh.c"
|
#include "math/acosh.c"
|
||||||
#include "math/asinh.c"
|
#include "math/asinh.c"
|
||||||
@@ -175,6 +176,7 @@ ksys_dll_t EXPORTS[] = {
|
|||||||
{ "calloc", &calloc },
|
{ "calloc", &calloc },
|
||||||
{ "_exit", &_exit },
|
{ "_exit", &_exit },
|
||||||
{ "exit", &exit },
|
{ "exit", &exit },
|
||||||
|
{ "abort", &abort },
|
||||||
{ "free", &free },
|
{ "free", &free },
|
||||||
{ "itoa", &itoa },
|
{ "itoa", &itoa },
|
||||||
{ "labs", &labs },
|
{ "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