summaryrefslogtreecommitdiff
path: root/src/stdio/__stdio_read.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/__stdio_read.c')
-rw-r--r--src/stdio/__stdio_read.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stdio/__stdio_read.c b/src/stdio/__stdio_read.c
index 909c36a9..ea675da3 100644
--- a/src/stdio/__stdio_read.c
+++ b/src/stdio/__stdio_read.c
@@ -9,7 +9,8 @@ size_t __stdio_read(FILE *f, unsigned char *buf, size_t len)
};
ssize_t cnt;
- cnt = syscall(SYS_readv, f->fd, iov, 2);
+ 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;