meta: move photon/libc to root

This commit is contained in:
2026-02-08 20:45:25 +00:00
parent f00e74260d
commit 345a37962e
140 changed files with 0 additions and 0 deletions

22
libc/sys/linux/sbrk.c Normal file
View File

@@ -0,0 +1,22 @@
#include "unistd.h"
#include <stddef.h>
#include <stdint.h>
void *__curr_brk = NULL;
void *sbrk(intptr_t increment)
{
if (!__curr_brk) {
brk(NULL);
}
uintptr_t end = (uintptr_t)__curr_brk + increment;
void *start = __curr_brk;
int res = brk((void *)end);
if (res == -1) {
return NULL;
}
return start;
}