modified some syscall code in rlibc, fs stuff

This commit is contained in:
2026-06-29 17:00:07 -05:00
parent 97357f3170
commit 432d160b7a
285 changed files with 4223 additions and 3957 deletions

View File

@@ -38,6 +38,26 @@ int strlen(const char* str) {
return len;
}
int strncmp(const char *s1, const char *s2, size_t n) {
// If n is 0, we don't compare anything and strings are "equal"
while (n > 0) {
// If characters don't match, or we hit the null-terminator of s1
if (*s1 != *s2) {
return *(unsigned char *)s1 - *(unsigned char *)s2;
}
// If we reached the end of the strings simultaneously
if (*s1 == '\0') {
break;
}
s1++;
s2++;
n--;
}
return 0;
}
static void* kernel_heap_start = (void*)KHEAP_START;
static void* kernel_heap_end = (void*)KHEAP_START;
alloc_header_t* blk_list = NULL;