diff options
Diffstat (limited to 'src/kernel/lib/std.c')
-rw-r--r-- | src/kernel/lib/std.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/kernel/lib/std.c b/src/kernel/lib/std.c index 316dfa3..85dff1a 100644 --- a/src/kernel/lib/std.c +++ b/src/kernel/lib/std.c @@ -1,5 +1,6 @@ #include "std.h" #include "core/sys.h" +#include <mem/mem.h> int errno = 0; @@ -9,3 +10,10 @@ void abort() { monitor_write("\n"); PANIC("abort() called, probably a memory manager failure."); } + +char *strdup(const char *src) { + char* ret = kmalloc(strlen(src) + 1); + if (ret == NULL) return ret; + strcpy(ret, src); + return ret; +} |