diff --git a/uart.c b/uart.c index 369ad15..83dbf6a 100644 --- a/uart.c +++ b/uart.c @@ -5,6 +5,9 @@ #include #include #include +#include +#include + #include int _write(int file, char *ptr, int len); @@ -36,3 +39,39 @@ int _write(int file, char *ptr, int len) { errno = EIO; return -1; } + +int _close(int file); +int _close(int file) { + (void)file; + return -1; +} + +int _fstat(int file, struct stat *st); +int _fstat(int file, struct stat *st) { + (void)file; + st->st_mode = S_IFCHR; + return 0; +} + +int _isatty(int file); +int _isatty(int file) { + (void)file; + return 1; +} + +int _lseek(int file, int ptr, int dir); +int _lseek(int file, int ptr, int dir) { + (void)file; + (void)ptr; + (void)dir; + return 0; +} + +// Optional — stubbed read (e.g. for scanf), returns 0 bytes +int _read(int file, char *ptr, int len); +int _read(int file, char *ptr, int len) { + (void)file; + (void)ptr; + (void)len; + return 0; +}