48 lines
894 B
C
48 lines
894 B
C
|
/*
|
||
|
* syscalls.c
|
||
|
*
|
||
|
* Created on: Dec 14, 2014
|
||
|
* Author: Mario Huettel <mario.huettel@gmx.net>
|
||
|
*/
|
||
|
|
||
|
extern char __ld_sheap; // Defined by the linker
|
||
|
extern char __ld_eheap;
|
||
|
char* _sbrk(int incr) {
|
||
|
|
||
|
static char *heap_end;
|
||
|
char *prev_heap_end;
|
||
|
|
||
|
if (heap_end == 0) {
|
||
|
heap_end = &__ld_sheap;
|
||
|
}
|
||
|
prev_heap_end = heap_end;
|
||
|
if (heap_end + incr > &__ld_eheap) {
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
heap_end += incr;
|
||
|
return (char*) prev_heap_end;
|
||
|
}
|
||
|
int _isatty(int fd) {
|
||
|
return 1;
|
||
|
}
|
||
|
int _close(int fd) {
|
||
|
return 0;
|
||
|
}
|
||
|
int _open(int fd) {
|
||
|
return 0;
|
||
|
}
|
||
|
int _fstat(void) {
|
||
|
return 0;
|
||
|
}
|
||
|
int _lseek(void) {
|
||
|
return 0;
|
||
|
}
|
||
|
int _read(void) {
|
||
|
return 0;
|
||
|
}
|
||
|
int _write(int fd, const void *buf, int count) {
|
||
|
//sendString((char*)buf, count);
|
||
|
return count;
|
||
|
}
|