41
* These functions are just dummy implemented to resolve symbols for linking to other objects
45
open(const char *name UNUSED, int flags UNUSED)
57
read(int fd UNUSED, void *buf UNUSED, size_t count UNUSED)
63
ioctl(int fd UNUSED, int req UNUSED, void *data UNUSED)
69
* These functions are required for using libc.a
72
write(int fd, const void *buf, size_t len)
79
src_buf_ptr = (char *) buf;
80
if (fd == 1 || fd == 2)
82
dst_buf_ptr = &dst_buf[0];
83
for (i = 0; i < len && i < 256; i++)
85
*dst_buf_ptr++ = *src_buf_ptr++;
86
if (src_buf_ptr[-1] == '\n')
87
*dst_buf_ptr++ = '\r';
89
len = dst_buf_ptr - &dst_buf[0];
90
src_buf_ptr = &dst_buf[0];
93
if(fd < 0 || fd >= FILEIO_MAX
94
|| fd_array[fd].type == FILEIO_TYPE_EMPTY
95
|| fd_array[fd].write == 0)
98
return fd_array[fd].write(&fd_array[fd], src_buf_ptr, len);