73 #include <sys/unistd.h> 77 #include <sys/types.h> 80 #if defined(STDOUT_SD) || defined(STDIN_SD) 89 int _read(
struct _reent *r,
int file,
char * ptr,
int len)
93 if (!len || (file != 0)) {
94 __errno_r(r) = EINVAL;
97 len = sdRead(&STDIN_SD, (uint8_t *)ptr, (
size_t)len);
103 __errno_r(r) = EINVAL;
111 int _lseek(
struct _reent *r,
int file,
int ptr,
int dir)
124 int _write(
struct _reent *r,
int file,
char * ptr,
int len)
129 #if defined(STDOUT_SD) 131 __errno_r(r) = EINVAL;
134 sdWrite(&STDOUT_SD, (uint8_t *)ptr, (
size_t)len);
142 int _close(
struct _reent *r,
int file)
153 caddr_t
_sbrk(
struct _reent *r,
int incr)
155 #if CH_CFG_USE_MEMCORE 158 chDbgCheck(incr >= 0);
159 p = chHeapAlloc(
NULL, (
size_t)incr);
161 __errno_r(r) = ENOMEM;
167 __errno_r(r) = ENOMEM;
176 int _fstat(
struct _reent *r,
int file,
struct stat * st)
181 memset(st, 0,
sizeof(*st));
182 st->st_mode = S_IFCHR;
189 int _isatty(
struct _reent *r,
int fd)
204 void _exit(
int status )
216 int _kill(
int pid,
int sig )
218 (void)pid; (void)sig;
caddr_t _sbrk(int nbytes)
int _write(int fd, const char *buf, size_t cnt)
int _lseek(int fd, off_t pos, int whence)
int _kill(int pid, int sig)
int stat(const char *name, struct stat *buf)
Display struct stat, from POSIX stat(0 or fstat(), in ASCII. NOT POSIX.
int _fstat(int fd, struct stat *st)
int _read(int fd, char *buf, size_t cnt)