16const char msg[] =
"\033[31m\nERR: Heap Collision!\n\033[0m";
21 char *prev_heap = heap_ptr;
29 return (ssize_t)prev_heap;
33ssize_t
_write(
int fd,
const void *buf,
size_t count)
37 for (
size_t i = 0; i < count; ++i) {
46 return (ssize_t)count;
49ssize_t
_read(
int fd,
char *buf,
size_t count)
66 return (ssize_t)(i + 1);
70 if (c == 0x08 || c == 0x7F) {
86 if (c >=
' ' && c <=
'~') {
108 st->st_mode = S_IFCHR;
120off_t
_lseek(
int fd, off_t offset,
int whence)
122 (void)fd; (void)offset; (void)whence;
130 while (1) { __asm__
volatile (
"wfi"); }
136 (void)pid; (void)sig;
int _kill(int pid, int sig)
int _fstat(int fd, struct stat *st)
off_t _lseek(int fd, off_t offset, int whence)
ssize_t _write(int fd, const void *buf, size_t count)
ssize_t _read(int fd, char *buf, size_t count)