summaryrefslogblamecommitdiff
path: root/src/kernel/lib/std.c
blob: 85dff1a12635ddcf9381ad076ddb43fbca80eeed (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12

                     
                    








                                                                    






                                             
#include "std.h"
#include "core/sys.h"
#include <mem/mem.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.");
}

char *strdup(const char *src) {
	char* ret = kmalloc(strlen(src) + 1);
	if (ret == NULL) return ret;
	strcpy(ret, src);
	return ret;
}