Stub out __stdio_read for Trusty.
Trusty does not support stdin.
Bug: 110161494
Change-Id: I7bd837ed39fa369adc7b207885aa5bb640fc2eee
diff --git a/src/stdio/__stdio_read.c b/src/stdio/__stdio_read.c
index ea675da..b3934ef 100644
--- a/src/stdio/__stdio_read.c
+++ b/src/stdio/__stdio_read.c
@@ -3,22 +3,7 @@
size_t __stdio_read(FILE *f, unsigned char *buf, size_t len)
{
- struct iovec iov[2] = {
- { .iov_base = buf, .iov_len = len - !!f->buf_size },
- { .iov_base = f->buf, .iov_len = f->buf_size }
- };
- ssize_t cnt;
-
- cnt = iov[0].iov_len ? syscall(SYS_readv, f->fd, iov, 2)
- : syscall(SYS_read, f->fd, iov[1].iov_base, iov[1].iov_len);
- if (cnt <= 0) {
- f->flags |= cnt ? F_ERR : F_EOF;
- return 0;
- }
- if (cnt <= iov[0].iov_len) return cnt;
- cnt -= iov[0].iov_len;
- f->rpos = f->buf;
- f->rend = f->buf + cnt;
- if (f->buf_size) buf[len-1] = *f->rpos++;
- return len;
+ /* TRUSTY - no read syscall. */
+ f->flags |= F_EOF;
+ return 0;
}
diff --git a/src/stdio/stdin.c b/src/stdio/stdin.c
index 5aa5262..5b8d2a8 100644
--- a/src/stdio/stdin.c
+++ b/src/stdio/stdin.c
@@ -2,7 +2,7 @@
#undef stdin
-static unsigned char buf[BUFSIZ+UNGET];
+static unsigned char buf[UNGET];
hidden FILE __stdin_FILE = {
.buf = buf+UNGET,
.buf_size = sizeof buf-UNGET,