diff options
Diffstat (limited to 'src/kernel/lib')
-rw-r--r-- | src/kernel/lib/std.c | 11 | ||||
-rw-r--r-- | src/kernel/lib/std.h | 14 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/kernel/lib/std.c b/src/kernel/lib/std.c new file mode 100644 index 0000000..316dfa3 --- /dev/null +++ b/src/kernel/lib/std.c @@ -0,0 +1,11 @@ +#include "std.h" +#include "core/sys.h" + +int errno = 0; + +void abort() { + monitor_write("\n\n ABORT - errno: "); + monitor_writeDec(errno); + monitor_write("\n"); + PANIC("abort() called, probably a memory manager failure."); +} diff --git a/src/kernel/lib/std.h b/src/kernel/lib/std.h new file mode 100644 index 0000000..51e0435 --- /dev/null +++ b/src/kernel/lib/std.h @@ -0,0 +1,14 @@ +#ifndef DEF_LIB_STD_H +#define DEF_LIB_STD_H + +// Functions enabling the use of dlmalloc code + +#include <types.h> /* For size_t */ + +void abort(); +#define sbrk ksbrk +#define brk kbrk + +extern int errno; + +#endif |