1/*2 * TODO: This is a temporary solution until we implement brk()3 * in Qute. This has been copied from arch/darwin/_getheap.c.4 */56#include <errno.h>7#include <stddef.h>89#include "../../syscall.h"1011static char heap[4096];1213void *14_getheap(void)15{16 return heap;17}1819int20_brk(void *addr)21{22 static char *cur = heap;23 char *p = addr;2425 if (p < heap || p > &heap[sizeof(heap) - 1]) {26 errno = ENOMEM;27 return -1;28 }29 cur = p;3031 return 0;32}