Last change
on this file since 514 was
444,
checked in by satin@…, 7 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
379 bytes
|
Rev | Line | |
---|
[444] | 1 | #include <_ansi.h> |
---|
| 2 | #include <sys/types.h> |
---|
| 3 | #include <sys/stat.h> |
---|
| 4 | #include "trap.h" |
---|
| 5 | |
---|
| 6 | |
---|
| 7 | caddr_t |
---|
| 8 | sbrk (size_t incr) |
---|
| 9 | { |
---|
| 10 | extern char end; /* Defined by the linker */ |
---|
| 11 | static char *heap_end; |
---|
| 12 | char *prev_heap_end; |
---|
| 13 | |
---|
| 14 | char *sp = (char *) &sp; |
---|
| 15 | |
---|
| 16 | if (heap_end == 0) |
---|
| 17 | { |
---|
| 18 | heap_end = &end; |
---|
| 19 | } |
---|
| 20 | prev_heap_end = heap_end; |
---|
| 21 | heap_end += incr; |
---|
| 22 | |
---|
| 23 | return (caddr_t) prev_heap_end; |
---|
| 24 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.