_brk.c (210B)
1 #include <errno.h> 2 #include <stddef.h> 3 4 #include "../../libc.h" 5 #include "../../syscall.h" 6 #include "brk.h" 7 8 int 9 _brk(void *addr) 10 { 11 if (_sys_brk(addr) != addr) { 12 errno = ENOMEM; 13 return -1; 14 } 15 return 0; 16 }