modified some syscall code in rlibc, fs stuff
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user