From fc66cc519ed7ef53c4f98b573a2ae341c1e6abed Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Sun, 17 Jan 2021 20:17:19 -0600 Subject: kernel: add string.h implementations Add implementations for functions declared in string.h. Signed-off-by: Danny Holman --- kernel/string.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 kernel/string.c diff --git a/kernel/string.c b/kernel/string.c new file mode 100644 index 0000000..3610909 --- /dev/null +++ b/kernel/string.c @@ -0,0 +1,24 @@ +#include + +int memcmp(const void *str1, const void *str2, size_t n) { + return 0; +} + +void* memcpy(void* __restrict dest, const void* __restrict src, size_t n) { + return NULL; +} + +void* memmove(void* __restrict dest, const void* __restrict src, size_t n) { + return NULL; +} + +void* memset(void *str, int c, size_t n) { + return NULL; +} + +size_t strlen(const char *str) { + size_t i = 0; + while (str[i] != '\0') + i++; + return i; +} -- cgit v1.2.3