lib: add libc and micro libc

This commit is contained in:
2026-02-19 19:28:50 +00:00
parent 9cc60cf3f1
commit ba455059ac
22 changed files with 9868 additions and 0 deletions

25
lib/ulibc/unistd/sbrk.c Normal file
View File

@@ -0,0 +1,25 @@
#include <mango/types.h>
#include <mango/vm.h>
#include <stdint.h>
#define BRK_SIZE 0x400000
static kern_handle_t heap_region = KERN_HANDLE_INVALID;
static kern_handle_t heap_object = KERN_HANDLE_INVALID;
static void *init_brk(size_t size)
{
kern_status_t status = KERN_OK;
return NULL;
}
void *sbrk(intptr_t increment)
{
kern_status_t status = KERN_OK;
if (heap_region == KERN_HANDLE_INVALID
|| heap_object == KERN_HANDLE_INVALID) {
return init_brk(BRK_SIZE);
}
return (void *)-1;
}