Last change
on this file since 650 was
444,
checked in by satin@…, 7 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
655 bytes
|
Rev | Line | |
---|
[444] | 1 | /* more sparclet syscall support (the rest is in crt0-701.S). */ |
---|
| 2 | |
---|
| 3 | #include <sys/types.h> |
---|
| 4 | #include <sys/stat.h> |
---|
| 5 | #include <errno.h> |
---|
| 6 | |
---|
| 7 | int |
---|
| 8 | fstat(int _fd, struct stat* _sbuf) |
---|
| 9 | { |
---|
| 10 | errno = ENOSYS; |
---|
| 11 | return -1; |
---|
| 12 | } |
---|
| 13 | |
---|
| 14 | int |
---|
| 15 | isatty(int fd) |
---|
| 16 | { |
---|
| 17 | if (fd < 0) |
---|
| 18 | { |
---|
| 19 | errno = EBADF; |
---|
| 20 | return -1; |
---|
| 21 | } |
---|
| 22 | return fd <= 2; |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | int |
---|
| 26 | getpid() |
---|
| 27 | { |
---|
| 28 | return 1; |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | int |
---|
| 32 | kill(int pid) |
---|
| 33 | { |
---|
| 34 | /* if we knew how to nuke the board, we would... */ |
---|
| 35 | return 0; |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | int |
---|
| 39 | lseek(int _fd, off_t offset, int whence) |
---|
| 40 | { |
---|
| 41 | errno = ENOSYS; |
---|
| 42 | return -1; |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | extern char end; |
---|
| 46 | char* |
---|
| 47 | sbrk (int incr) |
---|
| 48 | { |
---|
| 49 | static char* base; |
---|
| 50 | char *b; |
---|
| 51 | if(!base) base = &end; |
---|
| 52 | b = base; |
---|
| 53 | base += incr; |
---|
| 54 | return b; |
---|
| 55 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.