From cf7cd8be60c254b44b444c97dcb238d7cf3afd4c Mon Sep 17 00:00:00 2001 From: Brett Weiland Date: Tue, 21 Sep 2021 10:50:33 -0500 Subject: palloc smp safe (testing required, NOT pfree) --- src/kernel/libc.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/kernel/libc.c') diff --git a/src/kernel/libc.c b/src/kernel/libc.c index 4278281..f46c59f 100644 --- a/src/kernel/libc.c +++ b/src/kernel/libc.c @@ -1,5 +1,6 @@ #include #include +#include // TODO clean up variable names int strncmp(const char *s1, const char *s2, unsigned int n) { int i; @@ -18,6 +19,13 @@ size_t strlen(const char *s) { return(len); } +bool is_empty(const char *s, size_t size) { + for(size_t i = 0; i < size; i++) { + if(s[i]) return false; + } + return true; +} + int strcmp(const char *s1, const char *s2) { int i; for(i = 0; ((s1[i] != '\0') && (s2[i] != '\0')); i++) { -- cgit v1.2.3